summaryrefslogtreecommitdiffstats
path: root/sys/net/pf_ioctl.c
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2012-09-18 10:11:52 +0000
committerhenning <henning@openbsd.org>2012-09-18 10:11:52 +0000
commit08263cb1b79db2a3882e28adb4bf1ab2f466a144 (patch)
treebab510e3b895c2a2d154b32cfb3e96b830b5337b /sys/net/pf_ioctl.c
parentPrint the wieght in the show rib detail output. OK sthen@, henning@ (diff)
downloadwireguard-openbsd-08263cb1b79db2a3882e28adb4bf1ab2f466a144.tar.xz
wireguard-openbsd-08263cb1b79db2a3882e28adb4bf1ab2f466a144.zip
prio 0 is valid, therefore, I chose an "impossible" value for prio meaning
"not set" and used a PF_PRIO_NOTSET define for it. now that means that everything that creates a struct pf_rule doesn't get away with bzero'ing it, which turned out to be not so nice. so get rid of PF_PRIO_NOTSET, instead, make a rule+state flag PFSTATE_SETPRIO which indicates wether the prio should be set. ok benno claudio mikeb
Diffstat (limited to 'sys/net/pf_ioctl.c')
-rw-r--r--sys/net/pf_ioctl.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c
index 943c97a1a4b..4b71d1a7d6c 100644
--- a/sys/net/pf_ioctl.c
+++ b/sys/net/pf_ioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_ioctl.c,v 1.253 2012/07/08 07:58:09 henning Exp $ */
+/* $OpenBSD: pf_ioctl.c,v 1.254 2012/09/18 10:11:53 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -1088,10 +1088,9 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
error = EINVAL;
if (rule->rt && !rule->direction)
error = EINVAL;
- if ((rule->set_prio[0] != PF_PRIO_NOTSET &&
- rule->set_prio[0] > IFQ_MAXPRIO) ||
- (rule->set_prio[1] != PF_PRIO_NOTSET &&
- rule->set_prio[1] > IFQ_MAXPRIO))
+ if (rule->scrub_flags & PFSTATE_SETPRIO &&
+ (rule->set_prio[0] > IFQ_MAXPRIO ||
+ rule->set_prio[1] > IFQ_MAXPRIO))
error = EINVAL;
if (error) {