On Tue, Sep 07, 2010 at 01:50:58PM +0300, Alexander Shikoff wrote:
> > This code works for me.
> > 
> > This is a recent feature, perhaps you are using an old version of BIRD.
> > Try version 1.2.4 .
> I'm using 1.2.4.
> 
> Where do you call a function from? In my configuration it is called from
> filter:

...

> Error is the same: Sep  7 13:45:58 crete bird: filters, line 37: Can't 
> add/delete non-pair

Hello

There is a bug in community set delete. Try attached patch to fix it.

-- 
Elen sila lumenn' omentielvo

Ondrej 'SanTiago' Zajicek (email: santi...@crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
diff -uprN bird-1.2.4-o/filter/filter.c bird-1.2.4/filter/filter.c
--- bird-1.2.4-o/filter/filter.c	2010-08-03 17:44:51.000000000 +0200
+++ bird-1.2.4/filter/filter.c	2010-09-11 20:08:48.000000000 +0200
@@ -919,6 +919,9 @@ interpret(struct f_inst *what)
       runtime("Can't add/delete to non-clist");
 
     struct f_val dummy;
+    u16 op = what->aux;
+    i = 0;
+
     if ((v2.type == T_PAIR) || (v2.type == T_QUAD))
       i = v2.val.i;
 #ifndef IPV6
@@ -926,13 +929,13 @@ interpret(struct f_inst *what)
     else if (v2.type == T_IP)
       i = ipa_to_u32(v2.val.px.ip);
 #endif
-    else if ((v2.type == T_SET) && (what->aux == 'd') && clist_set_type(v2.val.t, &dummy))
-      what->aux = 'D';
+    else if ((v2.type == T_SET) && (op == 'd') && clist_set_type(v2.val.t, &dummy))
+      op = 'D';
     else
       runtime("Can't add/delete non-pair");
 
     res.type = T_CLIST;
-    switch (what->aux) {
+    switch (op) {
     case 'a': res.val.ad = int_set_add(f_pool, v1.val.ad, i); break;
     case 'd': res.val.ad = int_set_del(f_pool, v1.val.ad, i); break;
     case 'D': res.val.ad = clist_del_matching(f_pool, v1.val.ad, v2.val.t); break;

Attachment: signature.asc
Description: Digital signature

Reply via email to