summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2009-04-20 20:09:55 +0000
committerrwatson <rwatson@FreeBSD.org>2009-04-20 20:09:55 +0000
commitdd96787bc78284b906ccfb55f8cd2228da7bfaf9 (patch)
treeca9750578a69df1f61cba6cd28b18226bf8119ae /sys
parentbeb2b3b1a7ecbf3182043b3a292dac2ef792a200 (diff)
downloadFreeBSD-src-dd96787bc78284b906ccfb55f8cd2228da7bfaf9.zip
FreeBSD-src-dd96787bc78284b906ccfb55f8cd2228da7bfaf9.tar.gz
Prefer if_addrhead (FreeBSD) to if_addrlist (BSD compat) naming for the
interface address list in if_stf.c. Acquire interface address list locks around address list access. MFC after: 2 months
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_stf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c
index cc43e51..46757c9 100644
--- a/sys/net/if_stf.c
+++ b/sys/net/if_stf.c
@@ -382,7 +382,8 @@ stf_getsrcifa6(ifp)
struct sockaddr_in6 *sin6;
struct in_addr in;
- TAILQ_FOREACH(ia, &ifp->if_addrlist, ifa_list) {
+ IF_ADDR_LOCK(ifp);
+ TAILQ_FOREACH(ia, &ifp->if_addrhead, ifa_list) {
if (ia->ifa_addr->sa_family != AF_INET6)
continue;
sin6 = (struct sockaddr_in6 *)ia->ifa_addr;
@@ -396,8 +397,10 @@ stf_getsrcifa6(ifp)
if (ia4 == NULL)
continue;
+ IF_ADDR_UNLOCK(ifp);
return (struct in6_ifaddr *)ia;
}
+ IF_ADDR_UNLOCK(ifp);
return NULL;
}
OpenPOWER on IntegriCloud