summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2007-05-31 04:21:44 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2007-05-31 04:21:44 +0000
commit276c2174526d540fbad1ec9fd74602988620e0e9 (patch)
tree4f6a55ed10f2ac1b7f5579ad8c19d55b0736b59b
parent808c46dab6bf8f26178c3a57a2a7aa7267134a95 (diff)
Use COMMUNITY_UNSET in bgpctl as well. This makes it possible to filter
on communities with 0 in them.
-rw-r--r--usr.sbin/bgpctl/bgpctl.c5
-rw-r--r--usr.sbin/bgpctl/parser.c4
2 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c
index 7fd526763cd..02b5b7efa03 100644
--- a/usr.sbin/bgpctl/bgpctl.c
+++ b/usr.sbin/bgpctl/bgpctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpctl.c,v 1.124 2007/05/30 01:13:19 otto Exp $ */
+/* $OpenBSD: bgpctl.c,v 1.125 2007/05/31 04:21:43 claudio Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -215,7 +215,8 @@ main(int argc, char *argv[])
ribreq.prefixlen = res->prefixlen;
type = IMSG_CTL_SHOW_RIB_PREFIX;
}
- if (res->community.as != 0 && res->community.type != 0) {
+ if (res->community.as != COMMUNITY_UNSET &&
+ res->community.type != COMMUNITY_UNSET) {
memcpy(&ribreq.community, &res->community,
sizeof(res->community));
type = IMSG_CTL_SHOW_RIB_COMMUNITY;
diff --git a/usr.sbin/bgpctl/parser.c b/usr.sbin/bgpctl/parser.c
index ba4a0f3cead..e7304ca04db 100644
--- a/usr.sbin/bgpctl/parser.c
+++ b/usr.sbin/bgpctl/parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parser.c,v 1.45 2007/05/28 20:09:21 henning Exp $ */
+/* $OpenBSD: parser.c,v 1.46 2007/05/31 04:21:43 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -316,6 +316,8 @@ parse(int argc, char *argv[])
const struct token *match;
bzero(&res, sizeof(res));
+ res.community.as = COMMUNITY_UNSET;
+ res.community.type = COMMUNITY_UNSET;
TAILQ_INIT(&res.set);
while (argc >= 0) {