summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2002-12-13 21:48:32 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2002-12-13 21:48:32 +0000
commit74b65e1212e5b69c99fd0132a289ec8a4be28e01 (patch)
tree6049eb29966b971a753a9c31771e5dbc3bbb0aed /sys/net
parent38dcaab75735dd0c28737aa4bd08b59c9af05a57 (diff)
add pqueue and pqid to pf_rule.
this allows for a second queue on pf_rule. assign packets with tos 0x10 (lowdelay) to this one. if the second queue isn't specified set pqid = qid idea dhartmei@ ok dhartmei@ frantzen@ deraadt@
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/pf.c7
-rw-r--r--sys/net/pf_ioctl.c6
-rw-r--r--sys/net/pfvar.h4
3 files changed, 13 insertions, 4 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index f06258fd956..210f7109704 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.269 2002/12/06 00:47:32 dhartmei Exp $ */
+/* $OpenBSD: pf.c,v 1.270 2002/12/13 21:48:30 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -4350,7 +4350,10 @@ done:
mtag = m_tag_get(PACKET_TAG_PF_QID, sizeof(*atag), M_NOWAIT);
if (mtag != NULL) {
atag = (struct altq_tag *)(mtag + 1);
- atag->qid = r->qid;
+ if (pd.tos == IPTOS_LOWDELAY)
+ atag->qid = r->pqid;
+ else
+ atag->qid = r->qid;
/* add hints for ecn */
atag->af = AF_INET;
atag->hdr = h;
diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c
index 719631854b8..36d4997ef3c 100644
--- a/sys/net/pf_ioctl.c
+++ b/sys/net/pf_ioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_ioctl.c,v 1.24 2002/12/12 20:24:20 aaron Exp $ */
+/* $OpenBSD: pf_ioctl.c,v 1.25 2002/12/13 21:48:30 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -847,6 +847,10 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
break;
}
}
+#ifdef ALTQ
+ if (rule->qid && !rule->pqid)
+ rule->pqid = rule->qid;
+#endif /* ALTQ */
if (pf_dynaddr_setup(&rule->src.addr, rule->af))
error = EINVAL;
diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h
index 9c4c34546ad..99d17460d32 100644
--- a/sys/net/pfvar.h
+++ b/sys/net/pfvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfvar.h,v 1.109 2002/12/12 14:08:52 henning Exp $ */
+/* $OpenBSD: pfvar.h,v 1.110 2002/12/13 21:48:31 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -293,6 +293,7 @@ struct pf_rule {
#define PF_QNAME_SIZE 16
char ifname[IFNAMSIZ];
char qname[PF_QNAME_SIZE];
+ char pqname[PF_QNAME_SIZE];
#define PF_ANCHOR_NAME_SIZE 16
char anchorname[PF_ANCHOR_NAME_SIZE];
TAILQ_ENTRY(pf_rule) entries;
@@ -308,6 +309,7 @@ struct pf_rule {
u_int32_t states;
u_int32_t max_states;
u_int32_t qid;
+ u_int32_t pqid;
u_int32_t rt_listid;
u_int16_t nr;