summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormikeb <mikeb@openbsd.org>2017-05-24 16:34:17 +0000
committermikeb <mikeb@openbsd.org>2017-05-24 16:34:17 +0000
commit255c5c6ec44b153c7350bcb223c47775d1e5c255 (patch)
treea8fc4968c97c395bc772913f1a1ed338c151c8ab
parentWhen using "tcpdump proto 128" the filter never matched. A sign (diff)
downloadwireguard-openbsd-255c5c6ec44b153c7350bcb223c47775d1e5c255.tar.xz
wireguard-openbsd-255c5c6ec44b153c7350bcb223c47775d1e5c255.zip
Fail with EINVAL when asked to create a non-root queue instead of panicking
Prompted by a bug report from semarie@, thanks!
-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);