]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Renamed FF_OUTGOING to FF_FORCE_TMPATTR which much better fits the semantics.
authorMartin Mares <mj@ucw.cz>
Thu, 30 Mar 2000 08:50:30 +0000 (08:50 +0000)
committerMartin Mares <mj@ucw.cz>
Thu, 30 Mar 2000 08:50:30 +0000 (08:50 +0000)
Call rte_cow() instead of rte_do_cow(), so that COW works properly.

Stripped "\n" off several (de)bug messages.

filter/filter.c
filter/filter.h

index 6a590725862ccc9e6ec3614152ec97ca4227a545..fc9046594b70fc490a391692bb9dbf693321680b 100644 (file)
@@ -57,7 +57,8 @@ val_compare(struct f_val v1, struct f_val v2)
   case T_IP:
   case T_PREFIX:
     return ipa_compare(v1.val.px.ip, v2.val.px.ip);
-  default: { printf( "Error comparing\n" ); return CMP_ERROR; }
+  default:
+    return CMP_ERROR;
   }
 }
 
@@ -256,7 +257,7 @@ interpret(struct f_inst *what)
       * (struct f_val *) sym->aux2 = v2; 
       break;
     default:
-      bug( "Set to invalid type\n" );
+      bug( "Set to invalid type" );
     }
     break;
 
@@ -324,18 +325,18 @@ interpret(struct f_inst *what)
          break;
        }
       default:
-       bug( "Invalid type for rta access (%x)\n" );
+       bug( "Invalid type for rta access (%x)", res.type );
       }
     }
     break;
   case P('e','a'):     /* Access to extended attributes */
     {
       eattr *e = NULL;
-      if (!(f_flags & FF_OUTGOING))
+      if (!(f_flags & FF_FORCE_TMPATTR))
        e = ea_find( (*f_rte)->attrs->eattrs, what->a2.i );
       if (!e) 
        e = ea_find( (*f_tmp_attrs), what->a2.i );
-      if ((!e) && (f_flags & FF_OUTGOING))
+      if ((!e) && (f_flags & FF_FORCE_TMPATTR))
        e = ea_find( (*f_rte)->attrs->eattrs, what->a2.i );
       
       if (!e) {
@@ -353,7 +354,7 @@ interpret(struct f_inst *what)
   case P('e','S'):
     ONEARG;
     if (v1.type != what->aux)
-      runtime("Wrong type when setting dynamic attribute\n");
+      runtime("Wrong type when setting dynamic attribute");
 
     {
       struct ea_list *l = lp_alloc(f_pool, sizeof(struct ea_list) + sizeof(eattr));
@@ -377,8 +378,8 @@ interpret(struct f_inst *what)
        break;
       }
 
-      if (!(what->aux & EAF_TEMP) && (!(f_flags & FF_OUTGOING))) {
-       *f_rte = rte_do_cow(*f_rte);
+      if (!(what->aux & EAF_TEMP) && (!(f_flags & FF_FORCE_TMPATTR))) {
+       *f_rte = rte_cow(*f_rte);
        l->next = (*f_rte)->attrs->eattrs;
        (*f_rte)->attrs->eattrs = l;
       } else {
@@ -396,7 +397,7 @@ interpret(struct f_inst *what)
     switch(res.type) {
     case T_INT:        res.val.i = v1.val.px.len; break;
     case T_IP: res.val.px.ip = v1.val.px.ip; break;
-    default: bug( "Unknown prefix to conversion\n" );
+    default: bug( "Unknown prefix to conversion" );
     }
     break;
   case 'r':
@@ -424,7 +425,7 @@ interpret(struct f_inst *what)
        }
       }        
       if (!t->data)
-       die( "Impossible: no code associated!\n" );
+       bug( "Impossible: no code associated!" );
       return interpret(t->data);
     }
     break;
index b05e6a7a70f318d00e0a702b60f9512770a72d8e..a6868f976f892280aa10187ddb4969d5716989f2 100644 (file)
@@ -122,6 +122,6 @@ struct f_tree {
 
 #define NEW_F_VAL struct f_val * val; val = cfg_alloc(sizeof(struct f_val));
 
-#define FF_OUTGOING 1
+#define FF_FORCE_TMPATTR 1             /* Force all attributes to be temporary */
 
 #endif