Date: Wed, 04 Jan 2012 07:14:22 +0900 (JST) From: Hiroki Sato <hrs@FreeBSD.org> To: jhb@FreeBSD.org Cc: pluknet@FreeBSD.org, bz@FreeBSD.org, net@FreeBSD.org Subject: Re: [PATCH] Use of unreferenced ifa in in6 Message-ID: <20120104.071422.69305300858758112.hrs@allbsd.org> In-Reply-To: <201201031608.59688.jhb@freebsd.org> References: <201201031517.36251.jhb@freebsd.org> <CAE-mSOLhJ0O5DCjje%2BhHj1%2BO6c=MKR=7K0p5trj9T_XkPgWgng@mail.gmail.com> <201201031608.59688.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
----Security_Multipart0(Wed_Jan__4_07_14_22_2012_438)--
Content-Type: Multipart/Mixed;
boundary="--Next_Part(Wed_Jan__4_07_14_22_2012_691)--"
Content-Transfer-Encoding: 7bit
----Next_Part(Wed_Jan__4_07_14_22_2012_691)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
John Baldwin <jhb@freebsd.org> wrote
in <201201031608.59688.jhb@freebsd.org>:
jh> > With this patch in_lifaddr_ioctl() now looks more syntactically similar
jh> > to in6_lifaddr_ioctl(). They could look even more similar by eliminating
jh> > a lot of whitespace changes present here or there.
jh>
jh> Hmmm. Actually, it seems to be a bit more broken. Note that it is expecting
jh> to get a sockaddr_in, but it is checking for AF_INET6, not AF_INET in its
jh> loop. That bug seems to go back to the original import from KAME. I'm not
jh> sure if the two can be merged since they work on different underyling data
jh> structures though.
Hmm, a fix for that bug was not merged for some reason. Something
like the attached patch should be applied.
-- Hiroki
----Next_Part(Wed_Jan__4_07_14_22_2012_691)--
Content-Type: Text/X-Patch; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="in.c.20110104-1.diff"
Index: in.c
===================================================================
--- in.c (revision 229434)
+++ in.c (working copy)
@@ -735,7 +735,7 @@
if (iflr->flags & IFLR_PREFIX)
return (EINVAL);
- /* copy args to in_aliasreq, perform ioctl(SIOCAIFADDR_IN6). */
+ /* copy args to in_aliasreq, perform ioctl(SIOCAIFADDR_IN). */
bzero(&ifra, sizeof(ifra));
bcopy(iflr->iflr_name, ifra.ifra_name,
sizeof(ifra.ifra_name));
@@ -785,7 +785,7 @@
}
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
- if (ifa->ifa_addr->sa_family != AF_INET6)
+ if (ifa->ifa_addr->sa_family != AF_INET)
continue;
if (match.s_addr == 0)
break;
@@ -817,7 +817,7 @@
} else {
struct in_aliasreq ifra;
- /* fill in_aliasreq and do ioctl(SIOCDIFADDR_IN6) */
+ /* fill in_aliasreq and do ioctl(SIOCDIFADDR_IN) */
bzero(&ifra, sizeof(ifra));
bcopy(iflr->iflr_name, ifra.ifra_name,
sizeof(ifra.ifra_name));
----Next_Part(Wed_Jan__4_07_14_22_2012_691)----
----Security_Multipart0(Wed_Jan__4_07_14_22_2012_438)--
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)
iEYEABECAAYFAk8Dfb4ACgkQTyzT2CeTzy1heACg24CLnk58h0Vd9idaW064ejJ9
rloAn2nr/j7T1w718X+9pUKTF9MFhXgc
=xxZ4
-----END PGP SIGNATURE-----
----Security_Multipart0(Wed_Jan__4_07_14_22_2012_438)----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120104.071422.69305300858758112.hrs>
