summaryrefslogtreecommitdiff
path: root/sbin/pfctl
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/pfctl')
-rw-r--r--sbin/pfctl/pfctl.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index 7366dffdbaf..933ac31d94b 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl.c,v 1.333 2016/01/05 22:51:38 benno Exp $ */
+/* $OpenBSD: pfctl.c,v 1.334 2016/01/14 12:05:51 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -1119,6 +1119,16 @@ pfctl_add_queue(struct pfctl *pf, struct pf_queuespec *q)
return (1);
}
+ if (q->parent[0] == '\0') {
+ TAILQ_FOREACH(qi, &rootqs, entries) {
+ if (strcmp(q->ifname, qi->qs.ifname))
+ continue;
+ printf("A root queue is already defined on %s\n",
+ qi->qs.ifname);
+ return (1);
+ }
+ }
+
if ((qi = calloc(1, sizeof(*qi))) == NULL)
err(1, "calloc");
bcopy(q, &qi->qs, sizeof(qi->qs));