summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-03-11 14:02:13 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-03-11 14:02:13 +0000
commit40f4d573e80f0055aacb42fac2947ba1e2dc4129 (patch)
tree1dce77f6359cedc9b9e110f2c85e861674f849ce
parent543415874a1c668feea8f9f2dfd99155ee357c04 (diff)
do the queue ID assignment for cbq already in userland. ensure that queues
with different names always have different queue IDs, even if they live on different interfaces (that was the goal here). fixes regress pfaltq4 ok cedric@ dhartmei@
-rw-r--r--sbin/pfctl/pfctl_altq.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/pfctl/pfctl_altq.c b/sbin/pfctl/pfctl_altq.c
index f412fd9f5d3..54e7f735f65 100644
--- a/sbin/pfctl/pfctl_altq.c
+++ b/sbin/pfctl/pfctl_altq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_altq.c,v 1.45 2003/03/10 14:54:17 henning Exp $ */
+/* $OpenBSD: pfctl_altq.c,v 1.46 2003/03/11 14:02:12 henning Exp $ */
/*
* Copyright (C) 2002
@@ -81,6 +81,8 @@ static double sc_x2y(struct service_curve *, double);
u_int32_t getifspeed(char *);
u_long getifmtu(char *);
+static u_int32_t max_qid = 0;
+
void
pfaltq_store(struct pf_altq *a)
{
@@ -414,6 +416,8 @@ eval_pfqueue_cbq(struct pfctl *pf, struct pf_altq *pa)
if (pa->parent[0] == 0)
opts->flags |= (CBQCLF_ROOTCLASS | CBQCLF_WRR);
+ else if (pa->qid == 0 && (opts->flags & CBQCLF_DEFCLASS) == 0)
+ pa->qid = ++max_qid;
cbq_compute_idletime(pf, pa);
return (0);