aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/ipfw/ip_fw2.c
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2012-09-08 06:41:54 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2012-09-08 06:41:54 +0000
commitd6d3f01e0a3395c1fae34a3c4be7b051cb2d7581 (patch)
tree7b5b7e7d4dce516742188586df4e95db4183a7da /sys/netinet/ipfw/ip_fw2.c
parent76af1a93c99680818c746b7b1470f857eb3dc34d (diff)
downloadsrc-d6d3f01e0a3395c1fae34a3c4be7b051cb2d7581.tar.gz
src-d6d3f01e0a3395c1fae34a3c4be7b051cb2d7581.zip
Notes
Diffstat (limited to 'sys/netinet/ipfw/ip_fw2.c')
-rw-r--r--sys/netinet/ipfw/ip_fw2.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/netinet/ipfw/ip_fw2.c b/sys/netinet/ipfw/ip_fw2.c
index 18a9c5af511f..0dfab1f8ee91 100644
--- a/sys/netinet/ipfw/ip_fw2.c
+++ b/sys/netinet/ipfw/ip_fw2.c
@@ -1698,20 +1698,30 @@ do { \
case O_ALTQ: {
struct pf_mtag *at;
+ struct m_tag *mtag;
ipfw_insn_altq *altq = (ipfw_insn_altq *)cmd;
+ /*
+ * ALTQ uses mbuf tags from another
+ * packet filtering system - pf(4).
+ * We allocate a tag in its format
+ * and fill it in, pretending to be pf(4).
+ */
match = 1;
at = pf_find_mtag(m);
if (at != NULL && at->qid != 0)
break;
- at = pf_get_mtag(m);
- if (at == NULL) {
+ mtag = m_tag_get(PACKET_TAG_PF,
+ sizeof(struct pf_mtag), M_NOWAIT | M_ZERO);
+ if (mtag == NULL) {
/*
* Let the packet fall back to the
* default ALTQ.
*/
break;
}
+ m_tag_prepend(m, mtag);
+ at = (struct pf_mtag *)(mtag + 1);
at->qid = altq->qid;
at->hdr = ip;
break;