diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2020-01-24 05:44:06 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2020-01-24 05:44:06 +0000 |
commit | 18714bc720466665754233878ce5dc928c5e264c (patch) | |
tree | 1748273ea31fe1a803acc9dbc4715f1207c3edc1 /usr.sbin/bgpd/printconf.c | |
parent | e77c61be3d8b544fc0434e23b24bcef0665b0e8a (diff) |
Implement 'max-prefix NUM out' to limit the number of announced prefixes.
This is an easy safety switch to not leak full tables to upstreams and
peers. If the limit is hit a Cease notification is sent and the session
is closed.
This implements most of https://tools.ietf.org/html/draft-sa-idr-maxprefix-00
OK job@
Diffstat (limited to 'usr.sbin/bgpd/printconf.c')
-rw-r--r-- | usr.sbin/bgpd/printconf.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/printconf.c b/usr.sbin/bgpd/printconf.c index 429706a4bbb..caa03e1b407 100644 --- a/usr.sbin/bgpd/printconf.c +++ b/usr.sbin/bgpd/printconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: printconf.c,v 1.140 2019/08/07 10:26:41 claudio Exp $ */ +/* $OpenBSD: printconf.c,v 1.141 2020/01/24 05:44:05 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -616,6 +616,12 @@ print_peer(struct peer_config *p, struct bgpd_config *conf, const char *c) printf(" restart %u", p->max_prefix_restart); printf("\n"); } + if (p->max_out_prefix) { + printf("%s\tmax-prefix %u out", c, p->max_out_prefix); + if (p->max_out_prefix_restart) + printf(" restart %u", p->max_out_prefix_restart); + printf("\n"); + } if (p->holdtime) printf("%s\tholdtime %u\n", c, p->holdtime); if (p->min_holdtime) |