summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2008-05-06 06:34:11 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2008-05-06 06:34:11 +0000
commite9407bb95e8d4e9ba1b04233edf249b562699db3 (patch)
tree853727d1b5765b81c856f47a5fb6bf79c7f113b7
parent21f3cede71eed11fd7ea944dc988002046674476 (diff)
More missing RTM_VERSION checks. OK henning@
-rw-r--r--usr.sbin/ppp/ppp/arp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/ppp/ppp/arp.c b/usr.sbin/ppp/ppp/arp.c
index c343610868a..5deab1b29dc 100644
--- a/usr.sbin/ppp/ppp/arp.c
+++ b/usr.sbin/ppp/ppp/arp.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $OpenBSD: arp.c,v 1.14 2005/07/09 01:44:16 brad Exp $
+ * $OpenBSD: arp.c,v 1.15 2008/05/06 06:34:10 claudio Exp $
*
*/
@@ -264,15 +264,19 @@ arp_EtherAddr(int s, struct in_addr ipaddr, struct sockaddr_dl *hwaddr,
ifm = (struct if_msghdr *)ptr; /* On if_msghdr */
if (ifm->ifm_type != RTM_IFINFO)
break;
+ ptr += ifm->ifm_msglen;
+ if (ifm->ifm_version != RTM_VERSION)
+ continue;
dl = (struct sockaddr_dl *)(ifm + 1); /* Single _dl at end */
skip = (ifm->ifm_flags & (IFF_UP | IFF_BROADCAST | IFF_POINTOPOINT |
IFF_NOARP | IFF_LOOPBACK)) != (IFF_UP | IFF_BROADCAST);
- ptr += ifm->ifm_msglen; /* First ifa_msghdr */
while (ptr < end) {
ifam = (struct ifa_msghdr *)ptr; /* Next ifa_msghdr (alias) */
if (ifam->ifam_type != RTM_NEWADDR) /* finished ? */
break;
ptr += ifam->ifam_msglen;
+ if (ifam->ifam_version != RTM_VERSION)
+ continue;
if (skip || (ifam->ifam_addrs & (RTA_NETMASK|RTA_IFA)) !=
(RTA_NETMASK|RTA_IFA))
continue;