diff options
author | 2016-12-20 18:33:43 +0000 | |
---|---|---|
committer | 2016-12-20 18:33:43 +0000 | |
commit | 4eb8db84bc9d6a660b66b3f79301db47bc24b926 (patch) | |
tree | 0ccaf106b2bfb5c91eb9a0858f2bd9eae444e8c1 /sys/netinet6/ip6_input.c | |
parent | In midiread() and midiwrite(), add a second goto label to (diff) | |
download | wireguard-openbsd-4eb8db84bc9d6a660b66b3f79301db47bc24b926.tar.xz wireguard-openbsd-4eb8db84bc9d6a660b66b3f79301db47bc24b926.zip |
A NET_LOCK() was is missing in tcp_sysctl() which shows up as spl
softnet assert failures. It is better to place the lock into
net_sysctl() where all the protocol sysctls are called via pr_sysctl.
As calling sysctl(2) is in the slow path, doing fine grained locking
has no benefit. Many sysctl cases copy out a struct. Having a
lock around that keeps the struct consistent. Put assertions in
the protocol sysctls that need it.
OK mpi@
Diffstat (limited to 'sys/netinet6/ip6_input.c')
-rw-r--r-- | sys/netinet6/ip6_input.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index 3643cedd8ea..ee25a811a43 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_input.c,v 1.171 2016/12/19 08:36:50 mpi Exp $ */ +/* $OpenBSD: ip6_input.c,v 1.172 2016/12/20 18:33:43 bluhm Exp $ */ /* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */ /* @@ -1369,7 +1369,9 @@ ip6_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, extern int ip6_mrtproto; extern struct mrt6stat mrt6stat; #endif - int error, s; + int error; + + NET_ASSERT_LOCKED(); /* Almost all sysctl names at this level are terminal. */ if (namelen != 1 && name[0] != IPV6CTL_IFQUEUE) @@ -1409,12 +1411,9 @@ ip6_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, case IPV6CTL_MTUDISCTIMEOUT: error = sysctl_int(oldp, oldlenp, newp, newlen, &ip6_mtudisc_timeout); - if (icmp6_mtudisc_timeout_q != NULL) { - s = splsoftnet(); + if (icmp6_mtudisc_timeout_q != NULL) rt_timer_queue_change(icmp6_mtudisc_timeout_q, ip6_mtudisc_timeout); - splx(s); - } return (error); case IPV6CTL_IFQUEUE: return (sysctl_niq(name + 1, namelen - 1, |