summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bgpctl/parser.c
diff options
context:
space:
mode:
authorsthen <sthen@openbsd.org>2015-10-11 19:53:57 +0000
committersthen <sthen@openbsd.org>2015-10-11 19:53:57 +0000
commit17c84f898bdea754017bd02b035ce810ea94261c (patch)
tree866a6d376abada4b802bfe615e91c63f8c2574ba /usr.sbin/bgpctl/parser.c
parentstandardize a community that has been independently created by nearly (diff)
downloadwireguard-openbsd-17c84f898bdea754017bd02b035ce810ea94261c.tar.xz
wireguard-openbsd-17c84f898bdea754017bd02b035ce810ea94261c.zip
Handle the blackhole well-known community in bgpctl as well (print it
symbolically, and don't deny its use in 'bgpctl sh rib comm 65535:6666'). ok phessler@
Diffstat (limited to 'usr.sbin/bgpctl/parser.c')
-rw-r--r--usr.sbin/bgpctl/parser.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/bgpctl/parser.c b/usr.sbin/bgpctl/parser.c
index 7c51df92f32..72ddca08b36 100644
--- a/usr.sbin/bgpctl/parser.c
+++ b/usr.sbin/bgpctl/parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parser.c,v 1.72 2015/10/11 19:21:44 phessler Exp $ */
+/* $OpenBSD: parser.c,v 1.73 2015/10/11 19:53:57 sthen Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -914,6 +914,10 @@ parse_community(const char *word, struct parse_result *r)
as = COMMUNITY_WELLKNOWN;
type = COMMUNITY_NO_PEER;
goto done;
+ } else if (strcasecmp(word, "BLACKHOLE") == 0) {
+ as = COMMUNITY_WELLKNOWN;
+ type = COMMUNITY_BLACKHOLE;
+ goto done;
}
if ((p = strchr(word, ':')) == NULL) {
@@ -935,6 +939,7 @@ done:
case COMMUNITY_NO_EXPORT:
case COMMUNITY_NO_ADVERTISE:
case COMMUNITY_NO_EXPSUBCONFED:
+ case COMMUNITY_BLACKHOLE:
/* valid */
break;
default: