Acquire interfce address list lock while walking the interface address

list during tun device initialization.

MFC after:	2 weeks
This commit is contained in:
Robert Watson 2009-04-20 23:25:38 +00:00
parent 77ee4c0e00
commit 84f6005ccf

View File

@ -520,6 +520,7 @@ tuninit(struct ifnet *ifp)
getmicrotime(&ifp->if_lastchange);
#ifdef INET
IF_ADDR_LOCK(ifp);
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family == AF_INET) {
struct sockaddr_in *si;
@ -535,6 +536,7 @@ tuninit(struct ifnet *ifp)
mtx_unlock(&tp->tun_mtx);
}
}
IF_ADDR_UNLOCK(ifp);
#endif
return (error);
}