Author: zec
Date: Thu Sep 17 11:03:37 2009
New Revision: 197267
URL: http://svn.freebsd.org/changeset/base/197267

Log:
  MFC r197176:
  
    Lock the ifnet list while iterating over it.
  
    Submitted by: julian
    MFC after:    3 days
  
  Approved by:  re (kensmith)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/compat/linux/linux_ioctl.c
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/compat/linux/linux_ioctl.c
==============================================================================
--- stable/8/sys/compat/linux/linux_ioctl.c     Thu Sep 17 06:31:59 2009        
(r197266)
+++ stable/8/sys/compat/linux/linux_ioctl.c     Thu Sep 17 11:03:37 2009        
(r197267)
@@ -2152,6 +2152,7 @@ linux_ifconf(struct thread *td, struct i
        /* handle the 'request buffer size' case */
        if (ifc.ifc_buf == PTROUT(NULL)) {
                ifc.ifc_len = 0;
+               IFNET_RLOCK();
                TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
                        TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
                                struct sockaddr *sa = ifa->ifa_addr;
@@ -2159,6 +2160,7 @@ linux_ifconf(struct thread *td, struct i
                                        ifc.ifc_len += sizeof(ifr);
                        }
                }
+               IFNET_RUNLOCK();
                error = copyout(&ifc, uifc, sizeof(ifc));
                CURVNET_RESTORE();
                return (error);
_______________________________________________
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