diff options
| author | ozaki-r <ozaki-r@NetBSD.org> | 2017-12-26 02:26:45 +0000 |
|---|---|---|
| committer | ozaki-r <ozaki-r@NetBSD.org> | 2017-12-26 02:26:45 +0000 |
| commit | bb2fa0466fdb334d199d0d554255948b9ede6664 (patch) | |
| tree | 5038f0b51e299c94aad53ef05dc7881903e8c003 /sys | |
| parent | 6671687562271f6808b857e5b3859365572e9a40 (diff) | |
Work around softnet_lock handling
nd6_dad_stoptimer can be called with or without softnet_lock held.
callout_halt has to take softnet_lock depending on the situation.
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/netinet6/nd6_nbr.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c index 987d53fa087..4096750a05c 100644 --- a/sys/netinet6/nd6_nbr.c +++ b/sys/netinet6/nd6_nbr.c @@ -1,4 +1,4 @@ -/* $NetBSD: nd6_nbr.c,v 1.139 2017/11/17 07:37:12 ozaki-r Exp $ */ +/* $NetBSD: nd6_nbr.c,v 1.140 2017/12/26 02:26:45 ozaki-r Exp $ */ /* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */ /* @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.139 2017/11/17 07:37:12 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.140 2017/12/26 02:26:45 ozaki-r Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -1097,7 +1097,11 @@ nd6_dad_stoptimer(struct dadq *dp) #ifdef NET_MPSAFE callout_halt(&dp->dad_timer_ch, NULL); #else - callout_halt(&dp->dad_timer_ch, softnet_lock); + /* XXX still need the trick for softnet_lock */ + if (mutex_owned(softnet_lock)) + callout_halt(&dp->dad_timer_ch, softnet_lock); + else + callout_halt(&dp->dad_timer_ch, NULL); #endif } |
