mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-19 15:33:56 +00:00
Update if_stf and if_tun to use if_addr_rlock()/if_addr_runlock() rather
than IF_ADDR_LOCK()/IF_ADDR_UNLOCK() when iterating ifp->if_addrhead. MFC after: 6 weeks
This commit is contained in:
parent
f9ef96ca71
commit
3893212ddc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=195022
@ -384,7 +384,7 @@ stf_getsrcifa6(ifp)
|
||||
struct sockaddr_in6 *sin6;
|
||||
struct in_addr in;
|
||||
|
||||
IF_ADDR_LOCK(ifp);
|
||||
if_addr_rlock(ifp);
|
||||
TAILQ_FOREACH(ia, &ifp->if_addrhead, ifa_link) {
|
||||
if (ia->ifa_addr->sa_family != AF_INET6)
|
||||
continue;
|
||||
@ -400,10 +400,10 @@ stf_getsrcifa6(ifp)
|
||||
continue;
|
||||
|
||||
ifa_ref(ia);
|
||||
IF_ADDR_UNLOCK(ifp);
|
||||
if_addr_runlock(ifp);
|
||||
return (struct in6_ifaddr *)ia;
|
||||
}
|
||||
IF_ADDR_UNLOCK(ifp);
|
||||
if_addr_runlock(ifp);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -520,7 +520,7 @@ tuninit(struct ifnet *ifp)
|
||||
getmicrotime(&ifp->if_lastchange);
|
||||
|
||||
#ifdef INET
|
||||
IF_ADDR_LOCK(ifp);
|
||||
if_addr_rlock(ifp);
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
|
||||
if (ifa->ifa_addr->sa_family == AF_INET) {
|
||||
struct sockaddr_in *si;
|
||||
@ -536,7 +536,7 @@ tuninit(struct ifnet *ifp)
|
||||
mtx_unlock(&tp->tun_mtx);
|
||||
}
|
||||
}
|
||||
IF_ADDR_UNLOCK(ifp);
|
||||
if_addr_runlock(ifp);
|
||||
#endif
|
||||
return (error);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user