summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2013-09-10 12:58:24 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2013-09-10 12:58:24 +0200
commit507e182a60c3704f8a28a0450f1affc2c7c1b66a (patch)
treeeddf6af72a0304a226d425bced0b1aa2d171e047
parentd27e127aa996d500fed21be2bbbe888cafecb830 (diff)
Fixes reconfiguration of global set variables.
When global set variables were used, every reconfiguration restarted protocols that use it in filters. Thanks to Sergey Popovich for a bugreport.
-rw-r--r--filter/filter.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/filter/filter.c b/filter/filter.c
index 25587e0f..1f090528 100644
--- a/filter/filter.c
+++ b/filter/filter.c
@@ -1413,8 +1413,31 @@ i_same(struct f_inst *f1, struct f_inst *f2)
}
break;
case 'C':
- if (val_compare(* (struct f_val *) f1->a1.p, * (struct f_val *) f2->a1.p))
- return 0;
+ {
+ struct f_val *v1 = (struct f_val *) f1->a1.p;
+ struct f_val *v2 = (struct f_val *) f2->a1.p;
+
+ /* Handle some cases that are not handled by val_compare()
+ also T_PATH, T_CLIST and T_ECLIST does not work,
+ but you cannot easily create such constants */
+
+ if ((v1->type == T_SET) && (v2->type == T_SET))
+ {
+ if (!same_tree(v1->val.t, v2->val.t))
+ return 0;
+ break;
+ }
+
+ if ((v1->type == T_PREFIX_SET) && (v2->type == T_PREFIX_SET))
+ {
+ if (!trie_same(v1->val.ti, v2->val.ti))
+ return 0;
+ break;
+ }
+
+ if (val_compare(*v1 , *v2))
+ return 0;
+ }
break;
case 'V':
if (strcmp((char *) f1->a2.p, (char *) f2->a2.p))