summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbms <bms@FreeBSD.org>2009-03-09 22:54:17 +0000
committerbms <bms@FreeBSD.org>2009-03-09 22:54:17 +0000
commit4961c33f6ba9db1cfaf030d4fc201f7e886f4c4b (patch)
tree43134f71f13620a0c9482f1f27daf60b86a1ae7a
parent451bb286d90d5933813b70d3e37054facd0f8321 (diff)
downloadFreeBSD-src-4961c33f6ba9db1cfaf030d4fc201f7e886f4c4b.zip
FreeBSD-src-4961c33f6ba9db1cfaf030d4fc201f7e886f4c4b.tar.gz
Fix uninitialized use of ifp for ii.
Found by: Peter Holm
-rw-r--r--sys/netinet/in.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index 7c890b1..e2834bf 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -223,7 +223,6 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
int iaIsFirst;
ia = NULL;
- ii = ((struct in_ifinfo *)ifp->if_afdata[AF_INET]);
iaIsFirst = 0;
iaIsNew = 0;
allhosts_addr.s_addr = htonl(INADDR_ALLHOSTS_GROUP);
@@ -428,6 +427,7 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
if (error != 0 && iaIsNew)
break;
if (error == 0) {
+ ii = ((struct in_ifinfo *)ifp->if_afdata[AF_INET]);
if (iaIsFirst &&
(ifp->if_flags & IFF_MULTICAST) != 0) {
error = in_joingroup(ifp, &allhosts_addr,
@@ -478,6 +478,7 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
(ifra->ifra_broadaddr.sin_family == AF_INET))
ia->ia_broadaddr = ifra->ifra_broadaddr;
if (error == 0) {
+ ii = ((struct in_ifinfo *)ifp->if_afdata[AF_INET]);
if (iaIsFirst &&
(ifp->if_flags & IFF_MULTICAST) != 0) {
error = in_joingroup(ifp, &allhosts_addr,
@@ -529,6 +530,7 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
oia = NULL;
IFP_TO_IA(ifp, oia);
if (oia == NULL) {
+ ii = ((struct in_ifinfo *)ifp->if_afdata[AF_INET]);
IFF_LOCKGIANT(ifp);
IN_MULTI_LOCK();
if (ii->ii_allhosts) {
OpenPOWER on IntegriCloud