svn commit: r191343 - head/sys/net
Robert Watson
rwatson at FreeBSD.org
Mon Apr 20 23:25:38 UTC 2009
Author: rwatson
Date: Mon Apr 20 23:25:38 2009
New Revision: 191343
URL: http://svn.freebsd.org/changeset/base/191343
Log:
Acquire interfce address list lock while walking the interface address
list during tun device initialization.
MFC after: 2 weeks
Modified:
head/sys/net/if_tun.c
Modified: head/sys/net/if_tun.c
==============================================================================
--- head/sys/net/if_tun.c Mon Apr 20 23:23:31 2009 (r191342)
+++ head/sys/net/if_tun.c Mon Apr 20 23:25:38 2009 (r191343)
@@ -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);
}
More information about the svn-src-head
mailing list