Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Jan 2012 07:01:23 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r229465 - head/sys/netinet6
Message-ID:  <201201040701.q0471NUl065160@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Wed Jan  4 07:01:23 2012
New Revision: 229465
URL: http://svn.freebsd.org/changeset/base/229465

Log:
  Use correct locking when traversing interface address list.
  
  Reviewed by:	bz

Modified:
  head/sys/netinet6/in6.c

Modified: head/sys/netinet6/in6.c
==============================================================================
--- head/sys/netinet6/in6.c	Wed Jan  4 04:17:03 2012	(r229464)
+++ head/sys/netinet6/in6.c	Wed Jan  4 07:01:23 2012	(r229465)
@@ -2244,9 +2244,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;
@@ -2264,10 +2262,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])



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201040701.q0471NUl065160>