Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Use correct locking when traversing interface address list.

Reviewed by:	bz
  • Loading branch information...
commit f3494657389787e27d13f0ca7298ccae4986ee98 1 parent 21fa7c8
glebius authored January 04, 2012

Showing 1 changed file with 2 additions and 4 deletions. Show diff stats Hide diff stats

  1. 6  sys/netinet6/in6.c
6  sys/netinet6/in6.c
@@ -2244,9 +2244,7 @@ in6_ifawithifp(struct ifnet *ifp, struct in6_addr *dst)
2244 2244
 		IF_ADDR_UNLOCK(ifp);
2245 2245
 		return (besta);
2246 2246
 	}
2247  
-	IF_ADDR_UNLOCK(ifp);
2248 2247
 
2249  
-	IN6_IFADDR_RLOCK();
2250 2248
 	TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
2251 2249
 		if (ifa->ifa_addr->sa_family != AF_INET6)
2252 2250
 			continue;
@@ -2264,10 +2262,10 @@ in6_ifawithifp(struct ifnet *ifp, struct in6_addr *dst)
2264 2262
 
2265 2263
 		if (ifa != NULL)
2266 2264
 			ifa_ref(ifa);
2267  
-		IN6_IFADDR_RUNLOCK();
  2265
+		IF_ADDR_UNLOCK(ifp);
2268 2266
 		return (struct in6_ifaddr *)ifa;
2269 2267
 	}
2270  
-	IN6_IFADDR_RUNLOCK();
  2268
+	IF_ADDR_UNLOCK(ifp);
2271 2269
 
2272 2270
 	/* use the last-resort values, that are, deprecated addresses */
2273 2271
 	if (dep[0])

0 notes on commit f349465

Please sign in to comment.
Something went wrong with that request. Please try again.