PERFORCE change 143249 for review

Gleb Kurtsou gk at FreeBSD.org
Tue Jun 10 18:09:38 UTC 2008


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

Change 143249 by gk at gk_h1 on 2008/06/10 18:08:44

	don't delete MTAG_ETHER_HEADER after processing. tag can be used by another firewall
	packets passing through if_bridge can already contain tag

Affected files ...

.. //depot/projects/soc2008/gk_l2filter/sys-net/if_bridge.c#4 edit
.. //depot/projects/soc2008/gk_l2filter/sys-netinet/ip_fw_pfil.c#6 edit

Differences ...

==== //depot/projects/soc2008/gk_l2filter/sys-net/if_bridge.c#4 (text+ko) ====

@@ -2948,10 +2948,16 @@
 	error = 0;
 
 	if (ifp->if_flags & IFF_L2TAG) {
-		mtag_ether_header = m_tag_alloc(MTAG_ETHER, MTAG_ETHER_HEADER, ETHER_HDR_LEN, M_NOWAIT);
-		if (mtag_ether_header != NULL) {
-			memcpy(mtag_ether_header + 1, &eh2, ETHER_HDR_LEN);
-			m_tag_prepend(*mp, mtag_ether_header);
+		mtag_ether_header = m_tag_locate(*mp, MTAG_ETHER, MTAG_ETHER_HEADER,
+		    NULL);
+		/* XXX ??? can packet be tagged by another interface */
+		if (mtag_ether_header == NULL) {
+			mtag_ether_header = m_tag_alloc(MTAG_ETHER, MTAG_ETHER_HEADER,
+					ETHER_HDR_LEN, M_NOWAIT);
+			if (mtag_ether_header != NULL) {
+				memcpy(mtag_ether_header + 1, &eh2, ETHER_HDR_LEN);
+				m_tag_prepend(*mp, mtag_ether_header);
+			}
 		}
 	}
 

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

@@ -122,7 +122,6 @@
 	if (tag_ether_hdr != NULL) {
 		eh = *(struct ether_header *)(tag_ether_hdr + 1);
 		args.eh = &eh;
-		m_tag_delete(*m0, tag_ether_hdr);
 	}
 
 again:


More information about the p4-projects mailing list