From owner-p4-projects@FreeBSD.ORG Sun Jun 22 17:10:23 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 06B961065678; Sun, 22 Jun 2008 17:10:23 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC9A1106564A for ; Sun, 22 Jun 2008 17:10:22 +0000 (UTC) (envelope-from gk@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id B1AA18FC0A for ; Sun, 22 Jun 2008 17:10:22 +0000 (UTC) (envelope-from gk@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m5MHAMgb078853 for ; Sun, 22 Jun 2008 17:10:22 GMT (envelope-from gk@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m5MHAM0S078851 for perforce@freebsd.org; Sun, 22 Jun 2008 17:10:22 GMT (envelope-from gk@FreeBSD.org) Date: Sun, 22 Jun 2008 17:10:22 GMT Message-Id: <200806221710.m5MHAM0S078851@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gk@FreeBSD.org using -f From: Gleb Kurtsou To: Perforce Change Reviews Cc: Subject: PERFORCE change 143920 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2008 17:10:23 -0000 http://perforce.freebsd.org/chv.cgi?CH=143920 Change 143920 by gk@gk_h1 on 2008/06/22 17:09:25 fix if_bridge packet filtering Affected files ... .. //depot/projects/soc2008/gk_l2filter/sys-net/if_bridge.c#5 edit Differences ... ==== //depot/projects/soc2008/gk_l2filter/sys-net/if_bridge.c#5 (text+ko) ==== @@ -2848,7 +2848,7 @@ KASSERT(M_WRITABLE(*mp), ("%s: modifying a shared mbuf", __func__)); #endif - if (pfil_bridge == 0 && pfil_member == 0 && (ifp->if_flags & IFF_L2FILTER) == 0) + if (pfil_bridge == 0 && pfil_member == 0 && !(bifp != NULL && (bifp->if_flags & IFF_L2FILTER))) return (0); /* filtering is disabled */ i = min((*mp)->m_pkthdr.len, max_protohdr); @@ -2909,9 +2909,9 @@ goto bad; } - if (PFIL_HOOKED(ðer_pfil_hook) && (ifp->if_flags & IFF_L2FILTER) && - dir == PFIL_OUT && ifp != NULL) { - if (pfil_run_hooks(ðer_pfil_hook, mp, ifp, PFIL_OUT, NULL) != 0) + if (PFIL_HOOKED(ðer_pfil_hook) && dir == PFIL_OUT && bifp != NULL && + (bifp->if_flags & IFF_L2FILTER)) { + if (pfil_run_hooks(ðer_pfil_hook, mp, bifp, PFIL_OUT, NULL) != 0) return EACCES; } @@ -2947,7 +2947,8 @@ error = 0; - if (ifp->if_flags & IFF_L2TAG) { + /* Add tag if member or bridge interface has IFF_L2TAG set */ + if (((bifp ? bifp->if_flags : 0) | (ifp ? ifp->if_flags : 0)) & IFF_L2TAG) { mtag_ether_header = m_tag_locate(*mp, MTAG_ETHER, MTAG_ETHER_HEADER, NULL); /* XXX ??? can packet be tagged by another interface */