summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/printconf.c
diff options
context:
space:
mode:
authorPeter Hessler <phessler@cvs.openbsd.org>2017-05-27 10:33:16 +0000
committerPeter Hessler <phessler@cvs.openbsd.org>2017-05-27 10:33:16 +0000
commitefb6405e7545eb5d56da61172ae8d83dd2d83f68 (patch)
tree3d9fa3146d0848f975da194f96a7713ab1e117b4 /usr.sbin/bgpd/printconf.c
parentd8cd89b85096bd42ba8e0bac6ab519621550a679 (diff)
Allow OpenBGPD to selectively choose which local ASN to use per-peer.
This is intended to be used for ASN migrations, not for permanent use. You MUST use filters to protect yourself from receiving your own routes. There be dragons and grues. OK claudio@ benno@
Diffstat (limited to 'usr.sbin/bgpd/printconf.c')
-rw-r--r--usr.sbin/bgpd/printconf.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/printconf.c b/usr.sbin/bgpd/printconf.c
index d9bea4e4196..30cb76545db 100644
--- a/usr.sbin/bgpd/printconf.c
+++ b/usr.sbin/bgpd/printconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printconf.c,v 1.101 2017/05/27 10:24:44 phessler Exp $ */
+/* $OpenBSD: printconf.c,v 1.102 2017/05/27 10:33:15 phessler Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -424,6 +424,12 @@ print_peer(struct peer_config *p, struct bgpd_config *conf, const char *c)
printf("%s\trib \"%s\"\n", c, p->rib);
if (p->remote_as)
printf("%s\tremote-as %s\n", c, log_as(p->remote_as));
+ if (p->local_as != conf->as) {
+ printf("%s\tlocal-as %s", c, log_as(p->local_as));
+ if (p->local_as > USHRT_MAX && p->local_short_as != AS_TRANS)
+ printf(" %u", p->local_short_as);
+ printf("\n");
+ }
if (p->down)
printf("%s\tdown\n", c);
if (p->distance > 1)