In
case SIOCGLIFADDR:
case SIOCDLIFADDR:
there is a looop over addresses, and there is an extra & of something
that's already a pointer. (This bug was found by my colleague Mark
Keaton; it caused the ioctl not to find a match.)
I'll commit this to -current and request pullups if there are no
objections.
Index: sys/netinet/in.c
===================================================================
RCS file: /cvsroot/src/sys/netinet/in.c,v
retrieving revision 1.142
diff -u -p -r1.142 in.c
--- sys/netinet/in.c 12 Dec 2011 00:06:39 -0000 1.142
+++ sys/netinet/in.c 4 Jun 2012 18:47:22 -0000
@@ -729,7 +729,7 @@ in_lifaddr_ioctl(struct socket *so, u_lo
continue;
if (cmp == 0)
break;
- candidate.s_addr = ((struct sockaddr_in
*)&ifa->ifa_addr)->sin_addr.s_addr;
+ candidate.s_addr = ((struct sockaddr_in
*)ifa->ifa_addr)->sin_addr.s_addr;
candidate.s_addr &= mask.s_addr;
if (candidate.s_addr == match.s_addr)
break;
Attachment:
pgpWCmQHaQTi6.pgp
Description: PGP signature