summaryrefslogtreecommitdiff
path: root/sbin/pfctl/pfctl.c
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2017-04-26 15:51:00 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2017-04-26 15:51:00 +0000
commite6f8e536ed06b66bbbb07752174e78e055d12fad (patch)
tree7bcba606b88e6c2836bdc1ab5b087d447fe479c9 /sbin/pfctl/pfctl.c
parent606f6c2f05e79d2203a511379076bc2fa1ccd830 (diff)
Perform H-FSC root queue allocation in the kernel
Since only leaf queues can have packets assigned to them, H-FSC requires the user specified root queue to have a parent. To simplify userland tools and the configuration interface, the kernel can be leveraged to set it up. ok henning
Diffstat (limited to 'sbin/pfctl/pfctl.c')
-rw-r--r--sbin/pfctl/pfctl.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index 0ede855616d..9c39f37bb14 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl.c,v 1.341 2017/04/23 07:41:25 jmc Exp $ */
+/* $OpenBSD: pfctl.c,v 1.342 2017/04/26 15:50:59 mikeb Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -1342,7 +1342,7 @@ pfctl_load_queue(struct pfctl *pf, u_int32_t ticket, struct pfctl_qsitem *qi)
int
pfctl_load_queues(struct pfctl *pf)
{
- struct pfctl_qsitem *qi, *tempqi, rqi;
+ struct pfctl_qsitem *qi, *tempqi;
u_int32_t ticket;
TAILQ_FOREACH(qi, &qspecs, entries) {
@@ -1362,23 +1362,7 @@ pfctl_load_queues(struct pfctl *pf)
TAILQ_FOREACH_SAFE(qi, &rootqs, entries, tempqi) {
TAILQ_REMOVE(&rootqs, qi, entries);
-
- /*
- * We must have a hidden root queue below the user-
- * specified/visible root queue, due to the way the
- * dequeueing works far down there... don't ask.
- * the _ namespace is reserved for these.
- */
- bzero(&rqi, sizeof(rqi));
- TAILQ_INIT(&rqi.children);
- TAILQ_INSERT_TAIL(&rqi.children, qi, entries);
- snprintf(rqi.qs.qname, PF_QNAME_SIZE, "_root_%s",
- qi->qs.ifname);
- strlcpy(rqi.qs.ifname, qi->qs.ifname, sizeof(rqi.qs.ifname));
- strlcpy(qi->qs.parent, rqi.qs.qname, sizeof(qi->qs.parent));
-
- pfctl_load_queue(pf, ticket, &rqi);
-
+ pfctl_load_queue(pf, ticket, qi);
TAILQ_INSERT_HEAD(&rootqs, qi, entries);
}