Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Nov 2016 14:32:23 +0000 (UTC)
From:      Luiz Otavio O Souza <loos@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r308749 - stable/11/sys/netpfil/ipfw
Message-ID:  <201611171432.uAHEWNec056370@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: loos
Date: Thu Nov 17 14:32:23 2016
New Revision: 308749
URL: https://svnweb.freebsd.org/changeset/base/308749

Log:
  MFC r308237:
  
  Remove the mbuf tag after use (for reinjected packets).
  
  Fixes the packet processing in dummynet l2 rules.
  
  Obtained from:	pfSense
  Sponsored by:	Rubicon Communications, LLC (Netgate)

Modified:
  stable/11/sys/netpfil/ipfw/ip_fw_pfil.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netpfil/ipfw/ip_fw_pfil.c
==============================================================================
--- stable/11/sys/netpfil/ipfw/ip_fw_pfil.c	Thu Nov 17 14:03:44 2016	(r308748)
+++ stable/11/sys/netpfil/ipfw/ip_fw_pfil.c	Thu Nov 17 14:32:23 2016	(r308749)
@@ -315,20 +315,15 @@ ipfw_check_frame(void *arg, struct mbuf 
 	struct ip_fw_args args;
 	struct m_tag *mtag;
 
-	/* fetch start point from rule, if any */
+	/* fetch start point from rule, if any.  remove the tag if present. */
 	mtag = m_tag_locate(*m0, MTAG_IPFW_RULE, 0, NULL);
 	if (mtag == NULL) {
 		args.rule.slot = 0;
 	} else {
-		/* dummynet packet, already partially processed */
-		struct ipfw_rule_ref *r;
-
-		/* XXX can we free it after use ? */
-		mtag->m_tag_id = PACKET_TAG_NONE;
-		r = (struct ipfw_rule_ref *)(mtag + 1);
-		if (r->info & IPFW_ONEPASS)
+		args.rule = *((struct ipfw_rule_ref *)(mtag+1));
+		m_tag_delete(*m0, mtag);
+		if (args.rule.info & IPFW_ONEPASS)
 			return (0);
-		args.rule = *r;
 	}
 
 	/* I need some amt of data to be contiguous */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611171432.uAHEWNec056370>