summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2016-11-22 10:32:32 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2016-11-22 10:32:32 +0000
commitb3b8cfe170abbef6bf1272fe1fb1de10dcc8e953 (patch)
tree8f8cd68b603614f2fb3084472d6e726a5149c13a /sys
parent3c217555afd07546a7e8ab34e0e2479bcf03c897 (diff)
Enforce that pr_ctlinput, pr_slowtimo and pr_fasttimo are called
at IPL_SOFTNET. This will allow us to keep locking simple as soon as we trade splsoftnet() for a rwlock. ok bluhm@
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/uipc_domain.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c
index 5720e00d5c0..fb0cf9f46dc 100644
--- a/sys/kern/uipc_domain.c
+++ b/sys/kern/uipc_domain.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_domain.c,v 1.45 2016/03/03 00:34:10 dlg Exp $ */
+/* $OpenBSD: uipc_domain.c,v 1.46 2016/11/22 10:32:31 mpi Exp $ */
/* $NetBSD: uipc_domain.c,v 1.14 1996/02/09 19:00:44 christos Exp $ */
/*
@@ -219,13 +219,15 @@ pfctlinput(int cmd, struct sockaddr *sa)
{
struct domain *dp;
struct protosw *pr;
- int i;
+ int i, s;
+ s = splsoftnet();
for (i = 0; (dp = domains[i]) != NULL; i++) {
for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
if (pr->pr_ctlinput)
(*pr->pr_ctlinput)(cmd, sa, 0, NULL);
}
+ splx(s);
}
void
@@ -234,13 +236,15 @@ pfslowtimo(void *arg)
struct timeout *to = (struct timeout *)arg;
struct domain *dp;
struct protosw *pr;
- int i;
+ int i, s;
+ s = splsoftnet();
for (i = 0; (dp = domains[i]) != NULL; i++) {
for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
if (pr->pr_slowtimo)
(*pr->pr_slowtimo)();
}
+ splx(s);
timeout_add_msec(to, 500);
}
@@ -250,12 +254,14 @@ pffasttimo(void *arg)
struct timeout *to = (struct timeout *)arg;
struct domain *dp;
struct protosw *pr;
- int i;
+ int i, s;
+ s = splsoftnet();
for (i = 0; (dp = domains[i]) != NULL; i++) {
for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
if (pr->pr_fasttimo)
(*pr->pr_fasttimo)();
}
+ splx(s);
timeout_add_msec(to, 200);
}