summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2002-11-29 15:52:14 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2002-11-29 15:52:14 +0000
commit49f2b5fe9e3a6e3c7b185732447b2fc05190c9c7 (patch)
tree8b5a56a409069c38d2af4ce5ba3c14344d28895d
parent75fc459a822c92b742c5ee3690ab720b7368d1f4 (diff)
in pfctl_find_altq_node also compare the interface.
fixes pfctl -sq output in case the queuespec was expanded to >1 queues on different interfaces
-rw-r--r--sbin/pfctl/pfctl_altq.c13
-rw-r--r--sbin/pfctl/pfctl_altq.h4
2 files changed, 10 insertions, 7 deletions
diff --git a/sbin/pfctl/pfctl_altq.c b/sbin/pfctl/pfctl_altq.c
index 118c6d8d9c2..c487a85487f 100644
--- a/sbin/pfctl/pfctl_altq.c
+++ b/sbin/pfctl/pfctl_altq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_altq.c,v 1.14 2002/11/28 14:50:23 henning Exp $ */
+/* $OpenBSD: pfctl_altq.c,v 1.15 2002/11/29 15:52:13 henning Exp $ */
/*
* Copyright (C) 2002
* Sony Computer Science Laboratories Inc. All rights reserved.
@@ -496,7 +496,7 @@ pfctl_insert_altq_node(struct pf_altq_node **root,
} else {
struct pf_altq_node *parent;
- parent = pfctl_find_altq_node(*root, altq.parent);
+ parent = pfctl_find_altq_node(*root, altq.parent, altq.ifname);
if (parent == NULL) {
errx(1, "parent %s not found", altq.parent);
return;
@@ -514,15 +514,18 @@ pfctl_insert_altq_node(struct pf_altq_node **root,
}
struct pf_altq_node *
-pfctl_find_altq_node(struct pf_altq_node *root, const char *qname)
+pfctl_find_altq_node(struct pf_altq_node *root, const char *qname,
+ const char *ifname)
{
struct pf_altq_node *node, *child;
for (node = root; node != NULL; node = node->next) {
- if (!strcmp(node->altq.qname, qname))
+ if (!strcmp(node->altq.qname, qname)
+ && !(strcmp(node->altq.ifname, ifname)))
return (node);
if (node->children != NULL) {
- child = pfctl_find_altq_node(node->children, qname);
+ child = pfctl_find_altq_node(node->children, qname,
+ ifname);
if (child != NULL)
return (child);
}
diff --git a/sbin/pfctl/pfctl_altq.h b/sbin/pfctl/pfctl_altq.h
index c1b2aed579d..546e3badb36 100644
--- a/sbin/pfctl/pfctl_altq.h
+++ b/sbin/pfctl/pfctl_altq.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_altq.h,v 1.3 2002/11/27 16:23:01 henning Exp $ */
+/* $OpenBSD: pfctl_altq.h,v 1.4 2002/11/29 15:52:13 henning Exp $ */
/*
* Copyright (C) 2002
* Sony Computer Science Laboratories Inc. All rights reserved.
@@ -89,7 +89,7 @@ struct pf_altq_node {
void pfctl_insert_altq_node(struct pf_altq_node **,
const struct pf_altq);
struct pf_altq_node *pfctl_find_altq_node(struct pf_altq_node *,
- const char *);
+ const char *, const char *);
void pfctl_print_altq_node(const struct pf_altq_node *,
unsigned);
void pfctl_free_altq_node(struct pf_altq_node *);