summaryrefslogtreecommitdiff
path: root/sbin/pfctl/pfctl_altq.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-03-02 11:24:59 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-03-02 11:24:59 +0000
commit2a645f2feb5ab98793e620e3f9b6ac75db23ba2c (patch)
tree6cd834b5ae6f9749f20b498156927b169a741dab /sbin/pfctl/pfctl_altq.c
parent3e650f074f3b77dea14fb9189aa871f3e6fabaf4 (diff)
add a guarantee that two same named queues on different interfaces have the
same queue id. in the usual case this was already true, but not guaranteed. ok dhartmei@ kjc@
Diffstat (limited to 'sbin/pfctl/pfctl_altq.c')
-rw-r--r--sbin/pfctl/pfctl_altq.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sbin/pfctl/pfctl_altq.c b/sbin/pfctl/pfctl_altq.c
index 7a8baeca1b9..906b452382b 100644
--- a/sbin/pfctl/pfctl_altq.c
+++ b/sbin/pfctl/pfctl_altq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_altq.c,v 1.37 2003/02/25 12:03:02 henning Exp $ */
+/* $OpenBSD: pfctl_altq.c,v 1.38 2003/03/02 11:24:58 henning Exp $ */
/*
* Copyright (C) 2002
@@ -139,7 +139,8 @@ qname_to_qid(const char *qname, const char *ifname)
struct pf_altq *altq;
TAILQ_FOREACH(altq, &altqs, entries) {
- if (strncmp(ifname, altq->ifname, IFNAMSIZ) == 0 &&
+ if ((ifname == NULL ||
+ strncmp(ifname, altq->ifname, IFNAMSIZ) == 0) &&
strncmp(qname, altq->qname, PF_QNAME_SIZE) == 0)
return (altq->qid);
}
@@ -308,6 +309,7 @@ eval_pfqueue(struct pfctl *pf, struct pf_altq *pa, u_int32_t bw_absolute,
errx(1, "altq not defined on %s", pa->ifname);
pa->scheduler = if_pa->scheduler;
pa->ifbandwidth = if_pa->ifbandwidth;
+ pa->qid = qname_to_qid(pa->qname, NULL);
parent = NULL;
if (pa->parent[0] != 0) {