diff options
author | glebius <glebius@FreeBSD.org> | 2012-01-04 07:01:23 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2012-01-04 07:01:23 +0000 |
commit | 2886f1415cda856a3bebfd157865bae53bcd0acb (patch) | |
tree | dbd919dec5d3227bd13d8c0b50bdd59e785c6f98 /sys/netinet6 | |
parent | 3022368e0061df27acf90650489783e4cb0e244f (diff) | |
download | FreeBSD-src-2886f1415cda856a3bebfd157865bae53bcd0acb.zip FreeBSD-src-2886f1415cda856a3bebfd157865bae53bcd0acb.tar.gz |
Use correct locking when traversing interface address list.
Reviewed by: bz
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/in6.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index b8e0504..4b9bfb7 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -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]) |