diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2016-12-20 18:33:44 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2016-12-20 18:33:44 +0000 |
commit | 224769b48e66fb93384e8bf2e225552d3706a2c7 (patch) | |
tree | ce9b82c59578aba2b6b21289f3dcba94d2515ee1 /sys/netinet6/ip6_input.c | |
parent | e5175244e0715bec617be80d08e27d4d5daa2978 (diff) |
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, |