summaryrefslogtreecommitdiffstats
path: root/sys/net/hfsc.c
diff options
context:
space:
mode:
authormikeb <mikeb@openbsd.org>2017-05-08 11:30:53 +0000
committermikeb <mikeb@openbsd.org>2017-05-08 11:30:53 +0000
commitfafa79ace6af8be267c6a8adc11b4c372ea3913c (patch)
tree64917e746da3a77ff9eeb0da960f6a92dde5fd21 /sys/net/hfsc.c
parentUse C99 types and add a couple of missing macros needed for ctfconvert(1). (diff)
downloadwireguard-openbsd-fafa79ace6af8be267c6a8adc11b4c372ea3913c.tar.xz
wireguard-openbsd-fafa79ace6af8be267c6a8adc11b4c372ea3913c.zip
Add a compatibility shim for older pfctl binaries
Found by and input from dlg@, OK sthen, tedu, henning
Diffstat (limited to 'sys/net/hfsc.c')
-rw-r--r--sys/net/hfsc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/net/hfsc.c b/sys/net/hfsc.c
index 242f13ec53a..8fddbe5d933 100644
--- a/sys/net/hfsc.c
+++ b/sys/net/hfsc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hfsc.c,v 1.38 2017/05/02 12:27:37 mikeb Exp $ */
+/* $OpenBSD: hfsc.c,v 1.39 2017/05/08 11:30:53 mikeb Exp $ */
/*
* Copyright (c) 2012-2013 Henning Brauer <henning@openbsd.org>
@@ -392,6 +392,14 @@ hfsc_pf_addqueue(void *arg, struct pf_queuespec *q)
ulsc.d = q->upperlimit.d;
ulsc.m2 = q->upperlimit.m2.absolute;
+ /* Compatibility with older pfctl, return an EINVAL after 6.2 */
+ if (rtsc.m1 == 0 && rtsc.m2 == 0 && lssc.m1 == 0 &&
+ lssc.m2 == 0 && ulsc.m1 == 0 && ulsc.m2 == 0 &&
+ q->parent_qid == 0 && strncmp(q->qname, "_root_", 6) == 0) {
+ hfsc_class_destroy(hif, parent);
+ parent = NULL;
+ }
+
cl = hfsc_class_create(hif, &rtsc, &lssc, &ulsc,
parent, q->qlimit, q->flags, q->qid);
if (cl == NULL)