diff options
author | Chris Cappuccio <chris@cvs.openbsd.org> | 2009-05-23 17:03:07 +0000 |
---|---|---|
committer | Chris Cappuccio <chris@cvs.openbsd.org> | 2009-05-23 17:03:07 +0000 |
commit | bab3c6b72b9de41f7929c56991889a5e6ec9586b (patch) | |
tree | a2fcf470c0fce5ea9e416b7cad0b7f161a2f6b10 /usr.bin/netstat | |
parent | 9893ff78e44f45e4709ee64322ec163d5213e237 (diff) |
missed rtm_hdrlen conversion in two places
ok claudio@
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r-- | usr.bin/netstat/show.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/netstat/show.c b/usr.bin/netstat/show.c index 270e5af645f..d1863c44add 100644 --- a/usr.bin/netstat/show.c +++ b/usr.bin/netstat/show.c @@ -1,4 +1,4 @@ -/* $OpenBSD: show.c,v 1.21 2009/04/28 12:09:36 michele Exp $ */ +/* $OpenBSD: show.c,v 1.22 2009/05/23 17:03:06 chris Exp $ */ /* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */ /* @@ -150,7 +150,7 @@ p_rttables(int af, u_int tableid) rtm = (struct rt_msghdr *)next; if (rtm->rtm_version != RTM_VERSION) continue; - sa = (struct sockaddr *)(rtm + 1); + sa = (struct sockaddr *)(next + rtm->hdrlen); if (af != AF_UNSPEC && sa->sa_family != af) continue; p_rtentry(rtm); @@ -275,7 +275,7 @@ void p_rtentry(struct rt_msghdr *rtm) { static int old_af = -1; - struct sockaddr *sa = (struct sockaddr *)(rtm + 1); + struct sockaddr *sa = (struct sockaddr *)((char *)rtm + rtm->rtm_hdrlen); struct sockaddr *mask, *rti_info[RTAX_MAX]; char ifbuf[IF_NAMESIZE]; |