summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-04-26 04:40:12 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-04-26 04:40:12 +0000
commit3239e0c6c79fa0ba38f88076fa7af770e50697ae (patch)
treec2a48692cfb499921859c57575adbfa35b85ed23
parentc2d709e70cdf69569de01cb21481bdae527f746d (diff)
fix printing template neighbors
-rw-r--r--usr.sbin/bgpd/printconf.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.sbin/bgpd/printconf.c b/usr.sbin/bgpd/printconf.c
index 4e65aa11785..312ecf11a2f 100644
--- a/usr.sbin/bgpd/printconf.c
+++ b/usr.sbin/bgpd/printconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printconf.c,v 1.12 2004/03/17 12:40:38 claudio Exp $ */
+/* $OpenBSD: printconf.c,v 1.13 2004/04/26 04:40:11 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -133,10 +133,16 @@ print_peer(struct peer_config *p)
} else
c = nada;
- printf("%sneighbor %s {\n", c, log_addr(&p->remote_addr));
+ if ((p->remote_addr.af == AF_INET && p->remote_masklen != 32) ||
+ (p->remote_addr.af == AF_INET6 && p->remote_masklen != 128))
+ printf("%sneighbor %s/%u {\n", c, log_addr(&p->remote_addr),
+ p->remote_masklen);
+ else
+ printf("%sneighbor %s {\n", c, log_addr(&p->remote_addr));
if (p->descr[0])
printf("%s\tdescr \"%s\"\n", c, p->descr);
- printf("%s\tremote-as %u\n", c, p->remote_as);
+ if (p->remote_as)
+ printf("%s\tremote-as %u\n", c, p->remote_as);
if (p->distance > 1)
printf("%s\tmultihop %u\n", c, p->distance);
if (p->passive)