]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fix i_same for 'c' instruction.
authorPavel Machek <pavel@ucw.cz>
Thu, 8 Jun 2000 16:57:41 +0000 (16:57 +0000)
committerPavel Machek <pavel@ucw.cz>
Thu, 8 Jun 2000 16:57:41 +0000 (16:57 +0000)
filter/filter.c
filter/test.conf

index a7a17bd4fa05af97bf6c88528284e8bf603dba82..25711c5614ac74c24208b5a08a0c38102c73f53f 100644 (file)
@@ -748,7 +748,21 @@ i_same(struct f_inst *f1, struct f_inst *f2)
     }
     break;
 
-  case 'c': A2_SAME; break;
+  case 'c': 
+    if (f1->aux & T_SET) {
+      if (!same_tree(f1->a2.p, f2->a2.p))
+       return 0;
+      break;
+    } 
+    switch (f1->aux) {
+    case T_STRING:
+      if (strcmp(f1->a2.p, f2->a2.p))
+       return 0;
+      break;
+    default:
+      A2_SAME;
+    }
+    break;
   case 'C': 
     if (val_compare(* (struct f_val *) f1->a1.p, * (struct f_val *) f2->a1.p))
       return 0;
index 1b635cb7ca5262361d6113b150c5832548080c6b..73a651964b30239d3cba20d6d39cb26ded7408a0 100644 (file)
@@ -69,6 +69,26 @@ function bla()
 define four=4;
 define onetwo=1.2.3.4;
 
+function __test1()
+{
+        if source ~ [ RTS_BGP, RTS_STATIC ] then {                     
+#                       ospf_metric1 = 65535;                                                                     
+#                       ospf_metric2 = 1000;                                            
+                        ospf_tag = 0x12345678;                              
+                        accept;                                             
+        }                                                                                                                                                                                                                reject;                                                                                                                                                                                          
+}
+
+function __test2()
+{
+        if source ~ [ RTS_BGP, RTS_STATIC ] then {                     
+#                       ospf_metric1 = 65535;                                                                     
+#                       ospf_metric2 = 1000;                                            
+                        ospf_tag = 0x12345678;                              
+                        accept;                                             
+                }                                                                                                                                                                                                                reject;                                                                                                                                                                                          
+}
+
 function __startup() 
 int i;
 prefix px;
@@ -123,16 +143,6 @@ ip p;
 #      print "*** FAIL: this is unreachable"; 
 }
 
-function __test1()
-{
-       print bgp_path ~ / 65000 /;
-}
-
-function __test2()
-{
-       print bgp_path ~ / 65000 /;
-}
-
 filter testf 
 int j; 
 {