summaryrefslogtreecommitdiffstats
path: root/filter
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-09-11 20:14:53 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2010-09-11 20:14:53 +0200
commita58022a64ee8aa2fc46816020723dfbf4bfd08d9 (patch)
tree09ff49627487a63030f48736dde9707bad41edd7 /filter
parent4ca93a50675489a6a5ef9369c24806cc3cbff45e (diff)
downloadbird-a58022a64ee8aa2fc46816020723dfbf4bfd08d9.tar
bird-a58022a64ee8aa2fc46816020723dfbf4bfd08d9.zip
Fixes a bug in community set delete.
Diffstat (limited to 'filter')
-rw-r--r--filter/filter.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/filter/filter.c b/filter/filter.c
index 322fe09..971d230 100644
--- a/filter/filter.c
+++ b/filter/filter.c
@@ -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;