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
This commit is contained in:
Robert Watson 2009-04-20 20:09:55 +00:00
parent e454a17158
commit 989c0cb52a

View File

@ -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;
}