diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2017-11-14 14:46:50 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2017-11-14 14:46:50 +0000 |
commit | 90f0cef67a39a7de970b0210a839ba9c59ced39b (patch) | |
tree | c437c3e1fe190d4479651bc651b9bedd18441b76 /sys/netinet6/frag6.c | |
parent | 66a3557db8fb59674000beed8280ac7c2888eb6a (diff) |
Put the net lock around frag6_freef() as it sends ICMP6 error
messages. Splassert was triggered by regress/sys/netinet6/frag6.
OK mpi@ sashan@ visa@
Diffstat (limited to 'sys/netinet6/frag6.c')
-rw-r--r-- | sys/netinet6/frag6.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index c273fa05ca9..7b874e37bab 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frag6.c,v 1.80 2017/11/13 07:16:35 mpi Exp $ */ +/* $OpenBSD: frag6.c,v 1.81 2017/11/14 14:46:49 bluhm Exp $ */ /* $KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $ */ /* @@ -593,8 +593,12 @@ frag6_slowtimo(void) mtx_leave(&frag6_mutex); - while ((q6 = TAILQ_FIRST(&rmq6)) != NULL) { - TAILQ_REMOVE(&rmq6, q6, ip6q_queue); - frag6_freef(q6); + if (!TAILQ_EMPTY(&rmq6)) { + NET_LOCK(); + while ((q6 = TAILQ_FIRST(&rmq6)) != NULL) { + TAILQ_REMOVE(&rmq6, q6, ip6q_queue); + frag6_freef(q6); + } + NET_UNLOCK(); } } |