summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/rde_filter.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-06-06 01:10:30 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-06-06 01:10:30 +0000
commite30123f62cefd11d5df4928fb56d398c7d671bac (patch)
tree8b79dd9dddc6846dd2936fa4076a92f443652db1 /usr.sbin/bgpd/rde_filter.c
parentf1c395125acf7c5bdeb01ecdcf91dc81045d10da (diff)
Some preliminary filter magic to support multiple RIBs on the filters.
It is ugly but does the trick for now. Filters will be rewritten anyway. The rib specifier only makes sense on from rules. e.g. deny rib OMG from any
Diffstat (limited to 'usr.sbin/bgpd/rde_filter.c')
-rw-r--r--usr.sbin/bgpd/rde_filter.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/rde_filter.c b/usr.sbin/bgpd/rde_filter.c
index f3c40e253bd..001b796489f 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.55 2008/09/29 14:03:41 claudio Exp $ */
+/* $OpenBSD: rde_filter.c,v 1.56 2009/06/06 01:10:29 claudio Exp $ */
/*
* Copyright (c) 2004 Claudio Jeker <claudio@openbsd.org>
@@ -30,7 +30,7 @@ int rde_filter_match(struct filter_rule *, struct rde_aspath *,
int filterset_equal(struct filter_set_head *, struct filter_set_head *);
enum filter_actions
-rde_filter(struct rde_aspath **new, struct filter_head *rules,
+rde_filter(u_int16_t ribid, struct rde_aspath **new, struct filter_head *rules,
struct rde_peer *peer, struct rde_aspath *asp, struct bgpd_addr *prefix,
u_int8_t prefixlen, struct rde_peer *from, enum directions dir)
{
@@ -43,6 +43,8 @@ rde_filter(struct rde_aspath **new, struct filter_head *rules,
TAILQ_FOREACH(f, rules, entry) {
if (dir != f->dir)
continue;
+ if (dir == DIR_IN && f->peer.ribid != ribid)
+ continue;
if (f->peer.groupid != 0 &&
f->peer.groupid != peer->conf.groupid)
continue;