summaryrefslogtreecommitdiff
path: root/filter/filter.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-03-18 00:10:35 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2010-03-18 00:10:35 +0100
commit74e9331fe0892c4c96b4c4d7db3f14bb7e9d928e (patch)
treed6a11b64a328925df0de933b0ef797272aa8b3f2 /filter/filter.c
parent1528d30aebc462a13861d7cdb827e74556f3aa91 (diff)
Fixes behavior of defined() on bgp_community attribute.
Diffstat (limited to 'filter/filter.c')
-rw-r--r--filter/filter.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/filter/filter.c b/filter/filter.c
index 81bfd4e5..bfb480ab 100644
--- a/filter/filter.c
+++ b/filter/filter.c
@@ -607,12 +607,6 @@ interpret(struct f_inst *what)
e = ea_find( (*f_rte)->attrs->eattrs, what->a2.i );
if (!e) {
- /* A special case: undefined int_set looks like empty int_set */
- if ((what->aux & EAF_TYPE_MASK) == EAF_TYPE_INT_SET) {
- res.type = T_CLIST;
- res.val.ad = adata_empty(f_pool);
- break;
- }
/* Undefined value */
res.type = T_VOID;
break;
@@ -821,7 +815,11 @@ interpret(struct f_inst *what)
case P('C','a'): /* Community list add or delete */
TWOARGS;
- if (v1.type != T_CLIST)
+
+ /* Replace undefined value with empty community list */
+ if (v1.type == T_VOID)
+ v1.val.ad = adata_empty(f_pool);
+ else if (v1.type != T_CLIST)
runtime("Can't add/delete to non-clist");
if (v2.type != T_PAIR)
runtime("Can't add/delete non-pair");