Don't use if_maddr_rlock() in tuntap(4), use epoch(9) directly instead.

This commit is contained in:
Gleb Smirnoff 2019-10-10 23:51:14 +00:00
parent 4b24e5b1ef
commit 73c96bbeac
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=353425

View File

@ -1151,6 +1151,7 @@ tuninit(struct ifnet *ifp)
{
struct tuntap_softc *tp = ifp->if_softc;
#ifdef INET
struct epoch_tracker et;
struct ifaddr *ifa;
#endif
@ -1162,7 +1163,7 @@ tuninit(struct ifnet *ifp)
ifp->if_flags |= IFF_UP;
getmicrotime(&ifp->if_lastchange);
#ifdef INET
if_addr_rlock(ifp);
NET_EPOCH_ENTER(et);
CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family == AF_INET) {
struct sockaddr_in *si;
@ -1176,7 +1177,7 @@ tuninit(struct ifnet *ifp)
tp->tun_flags |= TUN_DSTADDR;
}
}
if_addr_runlock(ifp);
NET_EPOCH_EXIT(et);
#endif
TUN_UNLOCK(tp);
} else {