diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2009-03-29 18:31:48 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2009-03-29 18:31:48 +0000 |
commit | 7a52f7a732fb9cfaa3c097fd19c17e2e346881fb (patch) | |
tree | eda1b86cbd6b553af4e5977bab60cad2435265b7 /usr.sbin | |
parent | fb8fee5274dc7f2fe4cd88b27d148400080af7b1 (diff) |
Stop using the att_rtr member of struct lsa_net, we're going to remove it.
Calculate offsets with a struct lsa_net_link pointer instead.
ok claudio@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ospf6ctl/ospf6ctl.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.sbin/ospf6ctl/ospf6ctl.c b/usr.sbin/ospf6ctl/ospf6ctl.c index defaa14bc5a..af9abbb0d85 100644 --- a/usr.sbin/ospf6ctl/ospf6ctl.c +++ b/usr.sbin/ospf6ctl/ospf6ctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospf6ctl.c,v 1.25 2009/03/29 16:08:23 stsp Exp $ */ +/* $OpenBSD: ospf6ctl.c,v 1.26 2009/03/29 18:31:47 stsp Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -704,6 +704,7 @@ show_db_msg_detail(struct imsg *imsg) struct iface *iface; struct lsa *lsa; struct lsa_rtr_link *rtr_link; + struct lsa_net_link *net_link; struct lsa_prefix *prefix; struct lsa_asext *asext; u_int16_t i, nlinks, off; @@ -774,14 +775,16 @@ show_db_msg_detail(struct imsg *imsg) printf("Options: %s\n", print_ospf_options(LSA_24_GETLO(ntohl(lsa->data.net.opts)))); - nlinks = (ntohs(lsa->hdr.len) - sizeof(struct lsa_hdr) - - sizeof(u_int32_t)) / sizeof(struct lsa_net_link); - off = sizeof(lsa->hdr) + sizeof(u_int32_t); + nlinks = (ntohs(lsa->hdr.len) - sizeof(struct lsa_hdr) - + sizeof(struct lsa_net)) / sizeof(struct lsa_net_link); + net_link = (struct lsa_net_link *)((char *)lsa + + sizeof(lsa->hdr) + sizeof(lsa->data.net)); printf("Number of Routers: %d\n", nlinks); for (i = 0; i < nlinks; i++) { - addr.s_addr = lsa->data.net.att_rtr[i]; + addr.s_addr = net_link->att_rtr; printf(" Attached Router: %s\n", inet_ntoa(addr)); + net_link++; } printf("\n"); |