Permalink
Browse files

Use correct locking when traversing interface address list.

Reviewed by:	bz
  • Loading branch information...
glebius committed Jan 4, 2012
1 parent 21fa7c8 commit f3494657389787e27d13f0ca7298ccae4986ee98
Showing with 2 additions and 4 deletions.
  1. +2 −4 sys/netinet6/in6.c
View
@@ -2244,9 +2244,7 @@ in6_ifawithifp(struct ifnet *ifp, struct in6_addr *dst)
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 in6_addr *dst)
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])

0 comments on commit f349465

Please sign in to comment.