svn commit: r229638 - stable/8/sys/netinet6

John Baldwin jhb at FreeBSD.org
Thu Jan 5 19:56:54 UTC 2012


Author: jhb
Date: Thu Jan  5 19:56:54 2012
New Revision: 229638
URL: http://svn.freebsd.org/changeset/base/229638

Log:
  MFC 228866:
  Fix a bug where TAILQ_FIRST(&V_ifnet) was accessed without holding the
  proper lock.

Modified:
  stable/8/sys/netinet6/icmp6.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/netinet6/icmp6.c
==============================================================================
--- stable/8/sys/netinet6/icmp6.c	Thu Jan  5 19:56:30 2012	(r229637)
+++ stable/8/sys/netinet6/icmp6.c	Thu Jan  5 19:56:54 2012	(r229638)
@@ -1768,7 +1768,7 @@ static int
 ni6_store_addrs(struct icmp6_nodeinfo *ni6, struct icmp6_nodeinfo *nni6,
     struct ifnet *ifp0, int resid)
 {
-	struct ifnet *ifp = ifp0 ? ifp0 : TAILQ_FIRST(&V_ifnet);
+	struct ifnet *ifp;
 	struct in6_ifaddr *ifa6;
 	struct ifaddr *ifa;
 	struct ifnet *ifp_dep = NULL;
@@ -1781,6 +1781,7 @@ ni6_store_addrs(struct icmp6_nodeinfo *n
 		return (0);	/* needless to copy */
 
 	IFNET_RLOCK_NOSLEEP();
+	ifp = ifp0 ? ifp0 : TAILQ_FIRST(&V_ifnet);
   again:
 
 	for (; ifp; ifp = TAILQ_NEXT(ifp, if_list)) {


More information about the svn-src-all mailing list