Date: Tue, 10 Jun 2008 18:09:37 GMT From: Gleb Kurtsou <gk@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 143249 for review Message-ID: <200806101809.m5AI9bul024099@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=143249 Change 143249 by gk@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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806101809.m5AI9bul024099>