diff options
author | Chris Cappuccio <chris@cvs.openbsd.org> | 2009-06-05 22:40:25 +0000 |
---|---|---|
committer | Chris Cappuccio <chris@cvs.openbsd.org> | 2009-06-05 22:40:25 +0000 |
commit | 4e9d97f9bd4bf6ffea35c2fc1c968806bab268a6 (patch) | |
tree | 8dd99e6c5ab1c033916b198c7678a4a083f2aa9e /usr.sbin/snmpd | |
parent | 637897ed02de73e77d8087fcaf4bb06dfca62df0 (diff) |
rtm->rtm_hdrlen conversion
ok claudio@, henning@
Diffstat (limited to 'usr.sbin/snmpd')
-rw-r--r-- | usr.sbin/snmpd/kroute.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/snmpd/kroute.c b/usr.sbin/snmpd/kroute.c index 0cb0c337ad1..6772b6f516b 100644 --- a/usr.sbin/snmpd/kroute.c +++ b/usr.sbin/snmpd/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.6 2008/01/16 09:51:15 reyk Exp $ */ +/* $OpenBSD: kroute.c,v 1.7 2009/06/05 22:40:24 chris Exp $ */ /* * Copyright (c) 2007, 2008 Reyk Floeter <reyk@vantronix.net> @@ -812,7 +812,7 @@ fetchtable(void) lim = buf + len; for (next = buf; next < lim; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)next; - sa = (struct sockaddr *)(rtm + 1); + sa = (struct sockaddr *)(next + rtm->rtm_hdrlen); get_rtaddrs(rtm->rtm_addrs, sa, rti_info); if ((sa = rti_info[RTAX_DST]) == NULL) @@ -995,7 +995,7 @@ dispatch_rtmsg(int fd, short event, void *arg) if (rtm->rtm_type == RTM_ADD || rtm->rtm_type == RTM_CHANGE || rtm->rtm_type == RTM_DELETE) { - sa = (struct sockaddr *)(rtm + 1); + sa = (struct sockaddr *)(next + rtm->rtm_hdrlen); get_rtaddrs(rtm->rtm_addrs, sa, rti_info); if (rtm->rtm_tableid != 0) |