summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2016-11-28 11:12:46 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2016-11-28 11:12:46 +0000
commitae245da0445107d49b44888c87cc148a3f0dd5c8 (patch)
tree7aceee5da24cc15500f1478c3691519316cfd199 /sys
parentbee61d12ee3ec8711d987caada93af70892957f9 (diff)
Assert that every slow/fast timeout routine is called at IPL_SOFTNET.
This removes multipe recursive splsoftnet()/splx() dances.
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/igmp.c12
-rw-r--r--sys/netinet/ip_input.c6
-rw-r--r--sys/netinet/tcp_timer.c6
-rw-r--r--sys/netinet6/frag6.c7
4 files changed, 13 insertions, 18 deletions
diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c
index cc6bf91a480..1180f01bf30 100644
--- a/sys/netinet/igmp.c
+++ b/sys/netinet/igmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: igmp.c,v 1.54 2015/11/11 10:01:46 mpi Exp $ */
+/* $OpenBSD: igmp.c,v 1.55 2016/11/28 11:12:45 mpi Exp $ */
/* $NetBSD: igmp.c,v 1.15 1996/02/13 23:41:25 christos Exp $ */
/*
@@ -554,7 +554,8 @@ void
igmp_fasttimo(void)
{
struct ifnet *ifp;
- int s;
+
+ splsoftassert(IPL_SOFTNET);
/*
* Quick check to see if any work needs to be done, in order
@@ -563,11 +564,9 @@ igmp_fasttimo(void)
if (!igmp_timers_are_running)
return;
- s = splsoftnet();
igmp_timers_are_running = 0;
TAILQ_FOREACH(ifp, &ifnet, if_list)
igmp_checktimer(ifp);
- splx(s);
}
@@ -605,16 +604,15 @@ void
igmp_slowtimo(void)
{
struct router_info *rti;
- int s;
- s = splsoftnet();
+ splsoftassert(IPL_SOFTNET);
+
for (rti = rti_head; rti != 0; rti = rti->rti_next) {
if (rti->rti_type == IGMP_v1_ROUTER &&
++rti->rti_age >= IGMP_AGE_THRESHOLD) {
rti->rti_type = IGMP_v2_ROUTER;
}
}
- splx(s);
}
void
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 86dfce0d7d5..d96a77786cc 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_input.c,v 1.286 2016/11/23 10:04:31 mpi Exp $ */
+/* $OpenBSD: ip_input.c,v 1.287 2016/11/28 11:12:45 mpi Exp $ */
/* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */
/*
@@ -978,7 +978,8 @@ void
ip_slowtimo(void)
{
struct ipq *fp, *nfp;
- int s = splsoftnet();
+
+ splsoftassert(IPL_SOFTNET);
for (fp = LIST_FIRST(&ipq); fp != NULL; fp = nfp) {
nfp = LIST_NEXT(fp, ipq_q);
@@ -987,7 +988,6 @@ ip_slowtimo(void)
ip_freef(fp);
}
}
- splx(s);
}
/*
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c
index 698cb0bb0c9..661fe0c8b6d 100644
--- a/sys/netinet/tcp_timer.c
+++ b/sys/netinet/tcp_timer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_timer.c,v 1.51 2016/11/07 09:08:06 mpi Exp $ */
+/* $OpenBSD: tcp_timer.c,v 1.52 2016/11/28 11:12:45 mpi Exp $ */
/* $NetBSD: tcp_timer.c,v 1.14 1996/02/13 23:44:09 christos Exp $ */
/*
@@ -129,13 +129,11 @@ tcp_delack(void *arg)
void
tcp_slowtimo(void)
{
- int s;
+ splsoftassert(IPL_SOFTNET);
- s = splsoftnet();
tcp_maxidle = TCPTV_KEEPCNT * tcp_keepintvl;
tcp_iss += TCP_ISSINCR2/PR_SLOWHZ; /* increment iss */
tcp_now++; /* for timestamps */
- splx(s);
}
/*
diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c
index fb47d20c109..a8cff587aeb 100644
--- a/sys/netinet6/frag6.c
+++ b/sys/netinet6/frag6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: frag6.c,v 1.70 2016/10/24 11:09:05 bluhm Exp $ */
+/* $OpenBSD: frag6.c,v 1.71 2016/11/28 11:12:45 mpi Exp $ */
/* $KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $ */
/*
@@ -602,9 +602,9 @@ void
frag6_slowtimo(void)
{
struct ip6q *q6, *nq6;
- int s;
- s = splsoftnet();
+ splsoftassert(IPL_SOFTNET);
+
IP6Q_LOCK();
TAILQ_FOREACH_SAFE(q6, &frag6_queue, ip6q_queue, nq6)
if (--q6->ip6q_ttl == 0) {
@@ -623,7 +623,6 @@ frag6_slowtimo(void)
frag6_freef(TAILQ_LAST(&frag6_queue, ip6q_head));
}
IP6Q_UNLOCK();
- splx(s);
}
/*