summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2008-06-15 10:19:22 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2008-06-15 10:19:22 +0000
commita4b8685cf920a6fef16469ae8eb044b77715ec66 (patch)
tree0662859bb2305ebe82dcda8a585653dc3f9599ef
parent3c7fe1047b6d569a96a309886b7abce66afc28be (diff)
Allow bgpd to delete more then one community per filter rule. Fixes PR5807
tested by Raphael Ho long time ago.
-rw-r--r--usr.sbin/bgpd/parse.y5
-rw-r--r--usr.sbin/bgpd/rde_filter.c5
2 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index 2c8c60e1604..64d77e3cea4 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.215 2008/02/26 10:09:58 mpf Exp $ */
+/* $OpenBSD: parse.y,v 1.216 2008/06/15 10:19:21 claudio Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -2749,6 +2749,8 @@ merge_filterset(struct filter_set_head *sh, struct filter_set *s)
if (filterset_cmp(s, t) == 0) {
if (s->type == ACTION_SET_COMMUNITY)
yyerror("community is already set");
+ else if (s->type == ACTION_DEL_COMMUNITY)
+ yyerror("community will already be deleted");
else
yyerror("redefining set parameter %s",
filterset_name(s->type));
@@ -2764,6 +2766,7 @@ merge_filterset(struct filter_set_head *sh, struct filter_set *s)
if (s->type == t->type)
switch (s->type) {
case ACTION_SET_COMMUNITY:
+ case ACTION_DEL_COMMUNITY:
if (s->action.community.as <
t->action.community.as ||
(s->action.community.as ==
diff --git a/usr.sbin/bgpd/rde_filter.c b/usr.sbin/bgpd/rde_filter.c
index 2593f98bdb6..526756dc00e 100644
--- a/usr.sbin/bgpd/rde_filter.c
+++ b/usr.sbin/bgpd/rde_filter.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde_filter.c,v 1.53 2007/05/28 17:26:33 henning Exp $ */
+/* $OpenBSD: rde_filter.c,v 1.54 2008/06/15 10:19:21 claudio Exp $ */
/*
* Copyright (c) 2004 Claudio Jeker <claudio@openbsd.org>
@@ -462,7 +462,8 @@ filterset_cmp(struct filter_set *a, struct filter_set *b)
if (strcmp(filterset_name(a->type), filterset_name(b->type)))
return (a->type - b->type);
- if (a->type == ACTION_SET_COMMUNITY) { /* a->type == b->type */
+ if (a->type == ACTION_SET_COMMUNITY ||
+ a->type == ACTION_DEL_COMMUNITY) { /* a->type == b->type */
/* compare community */
if (a->action.community.as - b->action.community.as != 0)
return (a->action.community.as -