Author: bms
Date: Mon Mar  9 22:54:17 2009
New Revision: 189603
URL: http://svn.freebsd.org/changeset/base/189603

Log:
  Fix uninitialized use of ifp for ii.
  
  Found by:     Peter Holm

Modified:
  head/sys/netinet/in.c

Modified: head/sys/netinet/in.c
==============================================================================
--- head/sys/netinet/in.c       Mon Mar  9 22:43:00 2009        (r189602)
+++ head/sys/netinet/in.c       Mon Mar  9 22:54:17 2009        (r189603)
@@ -223,7 +223,6 @@ in_control(struct socket *so, u_long cmd
        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
                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
                    (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
                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) {
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to