summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/rde_filter.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2006-02-03 19:33:15 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2006-02-03 19:33:15 +0000
commitb6e3e03c2ad957cd6dbc2b4ca3aa48fa2ae3a947 (patch)
treebc9ed977e3c5761c6b7fd0406ac18365eb29d383 /usr.sbin/bgpd/rde_filter.c
parent403e95e54996eeab40152bbc3c2e58a7fc2ae477 (diff)
If the aspath gets copied because it is modified use the copy for filter
matching. With this it is possible to make later filters depend on previous filter changes -- e.g. via community attributes.
Diffstat (limited to 'usr.sbin/bgpd/rde_filter.c')
-rw-r--r--usr.sbin/bgpd/rde_filter.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/bgpd/rde_filter.c b/usr.sbin/bgpd/rde_filter.c
index 56d96a4d4bf..fa3d1c53b7d 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.44 2006/02/03 16:40:57 claudio Exp $ */
+/* $OpenBSD: rde_filter.c,v 1.45 2006/02/03 19:33:14 claudio Exp $ */
/*
* Copyright (c) 2004 Claudio Jeker <claudio@openbsd.org>
@@ -52,9 +52,12 @@ rde_filter(struct rde_aspath **new, struct filter_head *rules,
if (rde_filter_match(f, asp, prefix, prefixlen, peer)) {
if (asp != NULL && new != NULL) {
/* asp may get modified so create a copy */
- if (*new == NULL)
+ if (*new == NULL) {
*new = path_copy(asp);
- rde_apply_set(*new, &f->set, prefix->af,
+ /* ... and use the copy from now on */
+ asp = *new;
+ }
+ rde_apply_set(asp, &f->set, prefix->af,
from, peer);
}
if (f->action != ACTION_NONE)