svn commit: r231165 - stable/9/sys/netinet6

John Baldwin jhb at FreeBSD.org
Tue Feb 7 22:13:41 UTC 2012


Author: jhb
Date: Tue Feb  7 22:13:38 2012
New Revision: 231165
URL: http://svn.freebsd.org/changeset/base/231165

Log:
  MFC 229465: Use correct locking when traversing interface address list.

Modified:
  stable/9/sys/netinet6/in6.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/netinet6/in6.c
==============================================================================
--- stable/9/sys/netinet6/in6.c	Tue Feb  7 22:13:33 2012	(r231164)
+++ stable/9/sys/netinet6/in6.c	Tue Feb  7 22:13:38 2012	(r231165)
@@ -2211,9 +2211,7 @@ in6_ifawithifp(struct ifnet *ifp, struct
 		IF_ADDR_UNLOCK(ifp);
 		return (besta);
 	}
-	IF_ADDR_UNLOCK(ifp);
 
-	IN6_IFADDR_RLOCK();
 	TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
 		if (ifa->ifa_addr->sa_family != AF_INET6)
 			continue;
@@ -2231,10 +2229,10 @@ in6_ifawithifp(struct ifnet *ifp, struct
 
 		if (ifa != NULL)
 			ifa_ref(ifa);
-		IN6_IFADDR_RUNLOCK();
+		IF_ADDR_UNLOCK(ifp);
 		return (struct in6_ifaddr *)ifa;
 	}
-	IN6_IFADDR_RUNLOCK();
+	IF_ADDR_UNLOCK(ifp);
 
 	/* use the last-resort values, that are, deprecated addresses */
 	if (dep[0])


More information about the svn-src-stable-9 mailing list