]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
pair ~ community list matching works.
authorPavel Machek <pavel@ucw.cz>
Mon, 17 Apr 2000 11:49:21 +0000 (11:49 +0000)
committerPavel Machek <pavel@ucw.cz>
Mon, 17 Apr 2000 11:49:21 +0000 (11:49 +0000)
filter/filter.c
filter/test.conf

index f7b130a291acca1c151166e86ec1ac2e13d24174..6dc2ffd78771236755ffe0dc1384d107e569321d 100644 (file)
@@ -63,6 +63,8 @@ val_simple_in_range(struct f_val v1, struct f_val v2)
 {
   if ((v1.type == T_PATH) && (v2.type == T_PATH_MASK))
     return as_path_match(v1.val.ad, v2.val.path_mask);
+  if ((v1.type == T_PAIR) && (v2.type == T_CLIST))
+    return int_set_contains(v2.val.ad, v1.val.i);
 
   if ((v1.type == T_IP) && (v2.type == T_PREFIX))
     return !(ipa_compare(ipa_and(v2.val.px.ip, ipa_mkmask(v2.val.px.len)), ipa_and(v1.val.px.ip, ipa_mkmask(v2.val.px.len))));
index f266828a901a97589b3b1e085032e4dd997365d2..9e6e31d024dc5d459e1bd10f914e7ac51ae97069 100644 (file)
@@ -52,8 +52,10 @@ clist l;
        l = add( l, (1,2) );
        l = add( l, (2,3) );
        print "Community list (1,2) (2,3) ", l;
+       print "Should be true: ", (2,3) ~ l;
        l = delete( l, (2,3) );
        print "Community list (1,2) ", l;
+       print "Should be false: ", (2,3) ~ l;
 }
 
 function startup()