diff options
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) |