diff options
author | rwatson <rwatson@FreeBSD.org> | 2009-06-26 00:45:20 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2009-06-26 00:45:20 +0000 |
commit | 3dffb5419c2e44b4e7e028194f1c3828fad6a7dc (patch) | |
tree | b2ffd162276a5f916dc0ad8aa9fdb57250c5ad5f /sys | |
parent | c4ac6ab020126b381316fa8dcb627571af2683c8 (diff) | |
download | FreeBSD-src-3dffb5419c2e44b4e7e028194f1c3828fad6a7dc.zip FreeBSD-src-3dffb5419c2e44b4e7e028194f1c3828fad6a7dc.tar.gz |
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
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if_stf.c | 6 | ||||
-rw-r--r-- | sys/net/if_tun.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c index 12ce174..24e5ca5 100644 --- a/sys/net/if_stf.c +++ b/sys/net/if_stf.c @@ -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; } diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 41fbb47..a9a1c62 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -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); } |