summaryrefslogtreecommitdiff
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2016-11-21 09:09:07 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2016-11-21 09:09:07 +0000
commitbb797f408613b46cee97b8cac9de83beb3e39876 (patch)
treeff8330db4de384bfe2bafe652e2fe880ccde2d37 /sys/net/if.c
parentd6f258cf3464ccffb98335df1b2181475cfc792e (diff)
Enforce that pr_usrreq functions are called at IPL_SOFTNET.
This will allow us to keep locking simple as soon as we trade splsoftnet() for a rwlock. ok bluhm@, claudio@
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 02e5433a20f..1e6d190dc81 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.461 2016/11/14 10:52:04 mpi Exp $ */
+/* $OpenBSD: if.c,v 1.462 2016/11/21 09:09:06 mpi Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -2046,9 +2046,11 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p)
default:
if (so->so_proto == 0)
return (EOPNOTSUPP);
+ s = splsoftnet();
error = ((*so->so_proto->pr_usrreq)(so, PRU_CONTROL,
(struct mbuf *) cmd, (struct mbuf *) data,
(struct mbuf *) ifp, p));
+ splx(s);
break;
}