PERFORCE change 144240 for review

Gleb Kurtsou gk at FreeBSD.org
Sat Jun 28 20:48:00 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=144240

Change 144240 by gk at gk_h1 on 2008/06/28 20:47:23

	Check for tag in ipfw_check_out also.
	There is no longer need to store ethernet header in stack before passing it
	into ipfw_chk. And it's better to be avoided anyway.

Affected files ...

.. //depot/projects/soc2008/gk_l2filter/sys-netinet/ip_fw_pfil.c#7 edit

Differences ...

==== //depot/projects/soc2008/gk_l2filter/sys-netinet/ip_fw_pfil.c#7 (text+ko) ====

@@ -96,7 +96,6 @@
 	struct ng_ipfw_tag *ng_tag;
 	struct m_tag *tag_ether_hdr;
 	struct m_tag *dn_tag;
-	struct ether_header eh;
 	int ipfw = 0;
 	int divert;
 	int tee;
@@ -119,10 +118,8 @@
 
 	tag_ether_hdr = m_tag_locate(*m0, MTAG_ETHER, MTAG_ETHER_HEADER,
 	    NULL);
-	if (tag_ether_hdr != NULL) {
-		eh = *(struct ether_header *)(tag_ether_hdr + 1);
-		args.eh = &eh;
-	}
+	if (tag_ether_hdr != NULL)
+		args.eh = (struct ether_header *)(tag_ether_hdr + 1);
 
 again:
 	dn_tag = m_tag_find(*m0, PACKET_TAG_DUMMYNET, NULL);
@@ -225,6 +222,7 @@
 {
 	struct ip_fw_args args;
 	struct ng_ipfw_tag *ng_tag;
+	struct m_tag *tag_ether_hdr;
 	struct m_tag *dn_tag;
 	int ipfw = 0;
 	int divert;
@@ -246,6 +244,11 @@
 		m_tag_delete(*m0, (struct m_tag *)ng_tag);
 	}
 
+	tag_ether_hdr = m_tag_locate(*m0, MTAG_ETHER, MTAG_ETHER_HEADER,
+	    NULL);
+	if (tag_ether_hdr != NULL)
+		args.eh = (struct ether_header *)(tag_ether_hdr + 1);
+
 again:
 	dn_tag = m_tag_find(*m0, PACKET_TAG_DUMMYNET, NULL);
 	if (dn_tag != NULL) {


More information about the p4-projects mailing list