diff options
author | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2017-05-24 16:34:18 +0000 |
---|---|---|
committer | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2017-05-24 16:34:18 +0000 |
commit | 1ebb93739edf01f5a7f5b37477ba3690fcbdee40 (patch) | |
tree | f342ba8b8803c11ccbccc71e4d6368597f449621 /sys | |
parent | 51f9fbdaeb002c3d441214c1315c2fabae809f69 (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.c | 3 |
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); |