diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2012-03-27 18:22:08 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2012-03-27 18:22:08 +0000 |
commit | 074b33138df8b6c523644a2b2e3d17b6d8408202 (patch) | |
tree | 4ec95a888ebdce37e5edbf9a2622f418b2678eef /usr.sbin/bgpd | |
parent | 92416bdfae6bd8fc7de71d7839e6b1578da64d65 (diff) |
Introduce F_CTL_ACTIVE a flag to only show selected pathes.
Requested and OK deraadt@, OK henning@
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r-- | usr.sbin/bgpd/bgpd.h | 3 | ||||
-rw-r--r-- | usr.sbin/bgpd/rde.c | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h index 80e7e407522..16bf1e97f91 100644 --- a/usr.sbin/bgpd/bgpd.h +++ b/usr.sbin/bgpd/bgpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.h,v 1.267 2011/09/20 21:19:06 claudio Exp $ */ +/* $OpenBSD: bgpd.h,v 1.268 2012/03/27 18:22:07 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -82,6 +82,7 @@ #define F_CTL_DETAIL 0x1000 /* only used by bgpctl */ #define F_CTL_ADJ_IN 0x2000 #define F_CTL_ADJ_OUT 0x4000 +#define F_CTL_ACTIVE 0x8000 /* * Limit the number of control messages generated by the RDE and queued in diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index 46d140ba97a..fdc2122743f 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.311 2011/09/20 21:19:06 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.312 2012/03/27 18:22:07 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -2191,6 +2191,8 @@ rde_dump_filter(struct prefix *p, struct ctl_show_rib_request *req) !community_match(p->aspath, req->community.as, req->community.type)) return; + if ((req->flags & F_CTL_ACTIVE) && p->rib->active != p) + return; rde_dump_rib_as(p, p->aspath, req->pid, req->flags); } else if (req->flags & F_CTL_ADJ_OUT) { if (p->rib->active != p) |