summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/nd6.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2009-08-28 20:06:02 +0000
committerrwatson <rwatson@FreeBSD.org>2009-08-28 20:06:02 +0000
commit464ba339f01ef15c3bef8d990c268431fe769b42 (patch)
tree09f788d8608445b924626fff925bd963c42f6a0b /sys/netinet6/nd6.c
parentbc1de82641d5a9be69feee477bff716e1f245aa8 (diff)
downloadFreeBSD-src-464ba339f01ef15c3bef8d990c268431fe769b42.zip
FreeBSD-src-464ba339f01ef15c3bef8d990c268431fe769b42.tar.gz
Merge r196481 from head to stable/8:
Rework global locks for interface list and index management, correcting several critical bugs, including race conditions and lock order issues: Replace the single rwlock, ifnet_lock, with two locks, an rwlock and an sxlock. Either can be held to stablize the lists and indexes, but both are required to write. This allows the list to be held stable in both network interrupt contexts and sleepable user threads across sleeping memory allocations or device driver interactions. As before, writes to the interface list must occur from sleepable contexts. Reviewed by: bz, julian Approved by: re (kib)
Diffstat (limited to 'sys/netinet6/nd6.c')
-rw-r--r--sys/netinet6/nd6.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 48635c5..acaa87e 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -1662,7 +1662,7 @@ nd6_slowtimo(void *arg)
callout_reset(&V_nd6_slowtimo_ch, ND6_SLOWTIMER_INTERVAL * hz,
nd6_slowtimo, curvnet);
- IFNET_RLOCK();
+ IFNET_RLOCK_NOSLEEP();
for (ifp = TAILQ_FIRST(&V_ifnet); ifp;
ifp = TAILQ_NEXT(ifp, if_list)) {
nd6if = ND_IFINFO(ifp);
@@ -1678,7 +1678,7 @@ nd6_slowtimo(void *arg)
nd6if->reachable = ND_COMPUTE_RTIME(nd6if->basereachable);
}
}
- IFNET_RUNLOCK();
+ IFNET_RUNLOCK_NOSLEEP();
CURVNET_RESTORE();
}
OpenPOWER on IntegriCloud