summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2017-02-14 09:47:41 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2017-02-14 09:47:41 +0000
commitd5f4d21d984de66f0b50cc6213de650b42750556 (patch)
tree07e62e5217ae9a4b74579e542646bb6050def59c /sys
parent58933502fc90b2a07cab7800af4d0011c1af53a9 (diff)
Replace two recursive splsoftnet()/splx() dances with a splsoftassert().
ok mikeb@, bluhm@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/pfkeyv2.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/net/pfkeyv2.c b/sys/net/pfkeyv2.c
index 62b59cd91c2..0e2b11a3be6 100644
--- a/sys/net/pfkeyv2.c
+++ b/sys/net/pfkeyv2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkeyv2.c,v 1.150 2017/01/24 10:08:30 krw Exp $ */
+/* $OpenBSD: pfkeyv2.c,v 1.151 2017/02/14 09:47:40 mpi Exp $ */
/*
* @(#)COPYRIGHT 1.1 (NRL) 17 January 1995
@@ -2228,9 +2228,11 @@ pfkeyv2_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp,
void *new, size_t newlen)
{
struct pfkeyv2_sysctl_walk w;
- int s, error = EINVAL;
+ int error = EINVAL;
u_int rdomain;
+ splsoftassert(IPL_SOFTNET);
+
if (new)
return (EPERM);
if (namelen < 1)
@@ -2246,9 +2248,7 @@ pfkeyv2_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp,
case NET_KEY_SADB_DUMP:
if ((error = suser(curproc, 0)) != 0)
return (error);
- s = splsoftnet();
error = tdb_walk(rdomain, pfkeyv2_sysctl_walker, &w);
- splx(s);
if (oldp)
*oldlenp = w.w_where - oldp;
else
@@ -2256,10 +2256,8 @@ pfkeyv2_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp,
break;
case NET_KEY_SPD_DUMP:
- s = splsoftnet();
error = pfkeyv2_ipo_walk(rdomain,
pfkeyv2_sysctl_policydumper, &w);
- splx(s);
if (oldp)
*oldlenp = w.w_where - oldp;
else