summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2007-10-16 21:58:59 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2007-10-16 21:58:59 +0000
commit4d93c955376264d781bc492aaf1579c702657960 (patch)
tree40c088c0ed8359471c91f70d7722253045abdf03 /usr.sbin
parentb287365685674a9564352a814d55b4a16440f3d2 (diff)
Fix show database router output.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ospf6ctl/ospf6ctl.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/usr.sbin/ospf6ctl/ospf6ctl.c b/usr.sbin/ospf6ctl/ospf6ctl.c
index 168cacb5396..df088157392 100644
--- a/usr.sbin/ospf6ctl/ospf6ctl.c
+++ b/usr.sbin/ospf6ctl/ospf6ctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospf6ctl.c,v 1.9 2007/10/16 21:37:45 claudio Exp $ */
+/* $OpenBSD: ospf6ctl.c,v 1.10 2007/10/16 21:58:58 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -679,7 +679,8 @@ print_ospf_flags(u_int8_t opts)
{
static char optbuf[32];
- snprintf(optbuf, sizeof(optbuf), "*|*|*|*|*|%s|%s|%s",
+ snprintf(optbuf, sizeof(optbuf), "*|*|*|*|%s|%s|%s|%s",
+ opts & OSPF_RTR_W ? "W" : "-",
opts & OSPF_RTR_V ? "V" : "-",
opts & OSPF_RTR_E ? "E" : "-",
opts & OSPF_RTR_B ? "B" : "-");
@@ -749,8 +750,13 @@ show_db_msg_detail(struct imsg *imsg)
if (lsa->hdr.type != lasttype)
show_database_head(area_id, lsa->hdr.type);
show_db_hdr_msg_detail(&lsa->hdr);
- printf("Flags: %s\n", print_ospf_flags(lsa->data.rtr.flags));
- nlinks = ntohs(lsa->data.rtr.nlinks);
+ printf("Flags: %s\n",
+ print_ospf_flags(ntohl(lsa->data.rtr.opts) >> 24));
+ printf("Options: %s\n",
+ print_ospf_options(ntohl(lsa->data.rtr.opts)));
+
+ nlinks = (ntohs(lsa->hdr.len) - sizeof(struct lsa_hdr)
+ - sizeof(u_int32_t)) / sizeof(struct lsa_rtr_link);
printf("Number of Links: %d\n\n", nlinks);
off = sizeof(lsa->hdr) + sizeof(struct lsa_rtr);