summaryrefslogtreecommitdiff
path: root/sys/net/pf_ioctl.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2017-05-15 12:26:01 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2017-05-15 12:26:01 +0000
commit0fd09d947c319161c5f82677a302896ccec23406 (patch)
tree629e31aca9da15bfe31f0d735efbfd8b07a1c680 /sys/net/pf_ioctl.c
parentae80f51fcf7ad6757bb25f49546f7463a0ae3043 (diff)
Enable the NET_LOCK(), take 3.
Recursions are still marked as XXXSMP. ok deraadt@, bluhm@
Diffstat (limited to 'sys/net/pf_ioctl.c')
-rw-r--r--sys/net/pf_ioctl.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c
index fac156bae3f..7cb7b92ed8a 100644
--- a/sys/net/pf_ioctl.c
+++ b/sys/net/pf_ioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_ioctl.c,v 1.311 2017/05/15 11:23:25 mikeb Exp $ */
+/* $OpenBSD: pf_ioctl.c,v 1.312 2017/05/15 12:26:00 mpi Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -111,7 +111,6 @@ void pf_qid2qname(u_int16_t, char *);
void pf_qid_unref(u_int16_t);
struct pf_rule pf_default_rule, pf_default_rule_new;
-struct rwlock pf_consistency_lock = RWLOCK_INITIALIZER("pfcnslk");
struct {
char statusif[IFNAMSIZ];
@@ -999,12 +998,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
return (EACCES);
}
- if (flags & FWRITE)
- rw_enter_write(&pf_consistency_lock);
- else
- rw_enter_read(&pf_consistency_lock);
-
- s = splsoftnet();
+ NET_LOCK(s);
switch (cmd) {
case DIOCSTART:
@@ -2458,11 +2452,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
break;
}
fail:
- splx(s);
- if (flags & FWRITE)
- rw_exit_write(&pf_consistency_lock);
- else
- rw_exit_read(&pf_consistency_lock);
+ NET_UNLOCK(s);
return (error);
}