summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Henderson <sthen@cvs.openbsd.org>2016-11-19 12:46:47 +0000
committerStuart Henderson <sthen@cvs.openbsd.org>2016-11-19 12:46:47 +0000
commitb000445053ca3f94bebf6ddc651e5ce4e3c9ea66 (patch)
tree11753f87c3db8d2cbd2ebc30147e0ebadfb3e2ec
parentd98aa01ed8370008b0057ae88c1ed1540326f473 (diff)
Print metric and type for "redistribute" in ospfd -v.
From Remi Locherer, ok claudio
-rw-r--r--usr.sbin/ospfd/printconf.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/usr.sbin/ospfd/printconf.c b/usr.sbin/ospfd/printconf.c
index 516d45d504d..fa5536c1f99 100644
--- a/usr.sbin/ospfd/printconf.c
+++ b/usr.sbin/ospfd/printconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printconf.c,v 1.16 2013/03/06 15:43:23 sthen Exp $ */
+/* $OpenBSD: printconf.c,v 1.17 2016/11/19 12:46:46 sthen Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -76,24 +76,27 @@ print_redistribute(struct redist_list *rlh)
SIMPLEQ_FOREACH(r, rlh, entry) {
switch (r->type & ~REDIST_NO) {
case REDIST_STATIC:
- printf("%sredistribute static\n", print_no(r->type));
+ printf("%sredistribute static ", print_no(r->type));
break;
case REDIST_CONNECTED:
- printf("%sredistribute connected\n", print_no(r->type));
+ printf("%sredistribute connected ", print_no(r->type));
break;
case REDIST_LABEL:
- printf("%sredistribute rtlabel %s\n",
+ printf("%sredistribute rtlabel %s ",
print_no(r->type), rtlabel_id2name(r->label));
break;
case REDIST_ADDR:
- printf("%sredistribute %s/%d\n",
+ printf("%sredistribute %s/%d ",
print_no(r->type), inet_ntoa(r->addr),
mask2prefixlen(r->mask.s_addr));
break;
case REDIST_DEFAULT:
- printf("%sredistribute default\n", print_no(r->type));
+ printf("%sredistribute default ", print_no(r->type));
break;
}
+ printf("set { metric %d type %d }\n",
+ (r->metric & LSA_METRIC_MASK),
+ ((r->metric & LSA_ASEXT_E_FLAG) == 0 ? 1 : 2));
}
}