summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/in6_ifattach.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2009-06-25 16:35:28 +0000
committerrwatson <rwatson@FreeBSD.org>2009-06-25 16:35:28 +0000
commitbd6eb7be79d81290efa6dcaa9f492a05b1966344 (patch)
treeff4ff11920651e5f6aaeaa54e259e4f335eec1af /sys/netinet6/in6_ifattach.c
parent07492aedb8a9805aa9b5287012a05ac498d59d7b (diff)
downloadFreeBSD-src-bd6eb7be79d81290efa6dcaa9f492a05b1966344.zip
FreeBSD-src-bd6eb7be79d81290efa6dcaa9f492a05b1966344.tar.gz
Add address list locking for in6_ifaddrhead/ia_link: as with locking
for in_ifaddrhead, we stick with an rwlock for the time being, which we will revisit in the future with a possible move to rmlocks. Some pieces of code require significant further reworking to be safe from all classes of writer-writer races. Reviewed by: bz MFC after: 6 weeks
Diffstat (limited to 'sys/netinet6/in6_ifattach.c')
-rw-r--r--sys/netinet6/in6_ifattach.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c
index 3069c46..7fc1251 100644
--- a/sys/netinet6/in6_ifattach.c
+++ b/sys/netinet6/in6_ifattach.c
@@ -836,7 +836,9 @@ in6_ifdetach(struct ifnet *ifp)
IF_ADDR_UNLOCK(ifp);
ifa_free(ifa); /* if_addrhead */
+ IN6_IFADDR_WLOCK();
TAILQ_REMOVE(&V_in6_ifaddrhead, ia, ia_link);
+ IN6_IFADDR_WUNLOCK();
ifa_free(ifa);
}
OpenPOWER on IntegriCloud