From 968865031d084b4bd7ec48c1f6723f6810491cf8 Mon Sep 17 00:00:00 2001 From: phessler Date: Sun, 11 Oct 2015 19:30:12 +0000 Subject: [PATCH] standardize a community that has been independently created by nearly every single AS on the planet: the blackhole OK benno@, claudio@, sthen@ --- usr.sbin/bgpd/bgpd.conf.5 | 5 +++-- usr.sbin/bgpd/bgpd.h | 3 ++- usr.sbin/bgpd/parse.y | 6 +++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/usr.sbin/bgpd/bgpd.conf.5 b/usr.sbin/bgpd/bgpd.conf.5 index 50ea4195ee1..352c2de3136 100644 --- a/usr.sbin/bgpd/bgpd.conf.5 +++ b/usr.sbin/bgpd/bgpd.conf.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: bgpd.conf.5,v 1.138 2015/09/21 10:06:47 jmc Exp $ +.\" $OpenBSD: bgpd.conf.5,v 1.139 2015/10/11 19:30:12 phessler Exp $ .\" .\" Copyright (c) 2004 Claudio Jeker .\" Copyright (c) 2003, 2004 Henning Brauer @@ -16,7 +16,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: September 21 2015 $ +.Dd $Mdocdate: October 11 2015 $ .Dt BGPD.CONF 5 .Os .Sh NAME @@ -1097,6 +1097,7 @@ may be set to to do wildcard matching. Alternatively, well-known communities may be given by name instead and include +.Ic BLACKHOLE , .Ic NO_EXPORT , .Ic NO_ADVERTISE , .Ic NO_EXPORT_SUBCONFED , diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h index 297d1f99e54..8a187351ada 100644 --- a/usr.sbin/bgpd/bgpd.h +++ b/usr.sbin/bgpd/bgpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.h,v 1.290 2015/09/21 09:47:15 phessler Exp $ */ +/* $OpenBSD: bgpd.h,v 1.291 2015/10/11 19:30:12 phessler Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -718,6 +718,7 @@ struct filter_peers { #define COMMUNITY_NEIGHBOR_AS -3 #define COMMUNITY_UNSET -4 #define COMMUNITY_WELLKNOWN 0xffff +#define COMMUNITY_BLACKHOLE 0x029A /* draft-ymbk-grow-blackholing-01 */ #define COMMUNITY_NO_EXPORT 0xff01 #define COMMUNITY_NO_ADVERTISE 0xff02 #define COMMUNITY_NO_EXPSUBCONFED 0xff03 diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y index 14aff944072..8b0d5033aad 100644 --- a/usr.sbin/bgpd/parse.y +++ b/usr.sbin/bgpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.283 2015/09/21 09:47:15 phessler Exp $ */ +/* $OpenBSD: parse.y,v 1.284 2015/10/11 19:30:12 phessler Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer @@ -2800,6 +2800,10 @@ parsecommunity(struct filter_community *c, char *s) c->as = COMMUNITY_WELLKNOWN; c->type = COMMUNITY_NO_PEER; return (0); + } else if (strcasecmp(s, "BLACKHOLE") == 0) { + c->as = COMMUNITY_WELLKNOWN; + c->type = COMMUNITY_BLACKHOLE; + return (0); } if ((p = strchr(s, ':')) == NULL) { -- 2.20.1