From 7a52f7a732fb9cfaa3c097fd19c17e2e346881fb Mon Sep 17 00:00:00 2001 From: Stefan Sperling Date: Sun, 29 Mar 2009 18:31:48 +0000 Subject: 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@ --- usr.sbin/ospf6ctl/ospf6ctl.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'usr.sbin') 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 @@ -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"); -- cgit v1.2.3