diff options
author | Robert Watson <rwatson@FreeBSD.org> | 2009-06-25 16:35:28 +0000 |
---|---|---|
committer | Robert Watson <rwatson@FreeBSD.org> | 2009-06-25 16:35:28 +0000 |
commit | d1da0a0672600164899bfee5b854a738bca30086 (patch) | |
tree | ff4ff11920651e5f6aaeaa54e259e4f335eec1af /sys/netinet6/in6_ifattach.c | |
parent | b372d0d8bc8ce9b1d82fd7878069de9431ba6de5 (diff) | |
download | src-d1da0a0672600164899bfee5b854a738bca30086.tar.gz src-d1da0a0672600164899bfee5b854a738bca30086.zip |
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
Notes
Notes:
svn path=/head/; revision=194971
Diffstat (limited to 'sys/netinet6/in6_ifattach.c')
-rw-r--r-- | sys/netinet6/in6_ifattach.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c index 3069c467e5a6..7fc1251f235e 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); } |