summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/kroute.c
diff options
context:
space:
mode:
authorChris Cappuccio <chris@cvs.openbsd.org>2009-06-05 22:40:25 +0000
committerChris Cappuccio <chris@cvs.openbsd.org>2009-06-05 22:40:25 +0000
commit4e9d97f9bd4bf6ffea35c2fc1c968806bab268a6 (patch)
tree8dd99e6c5ab1c033916b198c7678a4a083f2aa9e /usr.sbin/bgpd/kroute.c
parent637897ed02de73e77d8087fcaf4bb06dfca62df0 (diff)
rtm->rtm_hdrlen conversion
ok claudio@, henning@
Diffstat (limited to 'usr.sbin/bgpd/kroute.c')
-rw-r--r--usr.sbin/bgpd/kroute.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/bgpd/kroute.c b/usr.sbin/bgpd/kroute.c
index c0a6f5edaf1..41fb84531f3 100644
--- a/usr.sbin/bgpd/kroute.c
+++ b/usr.sbin/bgpd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.166 2009/05/25 11:49:47 claudio Exp $ */
+/* $OpenBSD: kroute.c,v 1.167 2009/06/05 22:40:24 chris Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -2210,7 +2210,7 @@ fetchtable(u_int rtableid, int connected_only)
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)
@@ -2440,7 +2440,7 @@ dispatch_rtmsg(void)
case RTM_ADD:
case RTM_CHANGE:
case 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_pid == kr_state.pid) /* cause by us */