diff options
author | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2017-05-08 11:30:54 +0000 |
---|---|---|
committer | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2017-05-08 11:30:54 +0000 |
commit | 821629681523730f5c323757ccb12b8fe7b68a89 (patch) | |
tree | 746a5acb93ef77338b8f30a6df74d5d96830c07f /sys/net/hfsc.c | |
parent | 23b6850b9798f1025f3536d1eee7ddaa88d193ac (diff) |
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.c | 10 |
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) |