summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2017-05-24 16:34:18 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2017-05-24 16:34:18 +0000
commit1ebb93739edf01f5a7f5b37477ba3690fcbdee40 (patch)
treef342ba8b8803c11ccbccc71e4d6368597f449621 /sys
parent51f9fbdaeb002c3d441214c1315c2fabae809f69 (diff)
Fail with EINVAL when asked to create a non-root queue instead of panicking
Prompted by a bug report from semarie@, thanks!
Diffstat (limited to 'sys')
-rw-r--r--sys/net/fq_codel.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/net/fq_codel.c b/sys/net/fq_codel.c
index 9a094a3c386..8e9e065843a 100644
--- a/sys/net/fq_codel.c
+++ b/sys/net/fq_codel.c
@@ -689,7 +689,8 @@ fqcodel_pf_addqueue(void *arg, struct pf_queuespec *qs)
struct ifnet *ifp = qs->kif->pfik_ifp;
struct fqcodel *fqc = arg;
- KASSERT(qs->parent_qid == 0);
+ if (qs->parent_qid != 0)
+ return (EINVAL);
if (qs->flowqueue.flows == 0 || qs->flowqueue.flows > M_FLOWID_MASK)
return (EINVAL);