From owner-freebsd-bugs Wed Oct 30 9:40: 8 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7D23F37B406 for ; Wed, 30 Oct 2002 09:40:06 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3657E43E42 for ; Wed, 30 Oct 2002 09:40:06 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g9UHe5x3046501 for ; Wed, 30 Oct 2002 09:40:05 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g9UHe5hs046499; Wed, 30 Oct 2002 09:40:05 -0800 (PST) Date: Wed, 30 Oct 2002 09:40:05 -0800 (PST) Message-Id: <200210301740.g9UHe5hs046499@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Andriy Gapon Subject: Re: kern/44417: ipfw layer2 rules are not checked for ether_output_frame() on bridged interface Reply-To: Andriy Gapon Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR kern/44417; it has been noted by GNATS. From: Andriy Gapon To: Luigi Rizzo Cc: FreeBSD-gnats-submit@FreeBSD.ORG, freebsd-ipfw@FreeBSD.ORG Subject: Re: kern/44417: ipfw layer2 rules are not checked for ether_output_frame() on bridged interface Date: Wed, 30 Oct 2002 12:37:15 -0500 (EST) Luigi, you are right - my patch is incorrect, firewall rules are checked at the wrong place. This one should be better: 391,406d390 < if (rule) /* packet was already bridged */ < goto no_bridge; < < if (BDG_ACTIVE(ifp) ) { < struct ether_header *eh; /* a ptr suffices */ < < m->m_pkthdr.rcvif = NULL; < eh = mtod(m, struct ether_header *); < m_adj(m, ETHER_HDR_LEN); < m = bdg_forward_ptr(m, eh, ifp); < if (m != NULL) < m_freem(m); < return (0); < } < < no_bridge: 432a417,429 > } > > if (BDG_ACTIVE(ifp) ) { > splx(s); /* XXX */ > struct ether_header *eh; /* a ptr suffices */ > > m->m_pkthdr.rcvif = NULL; > eh = mtod(m, struct ether_header *); > m_adj(m, ETHER_HDR_LEN); > m = bdg_forward_ptr(m, eh, ifp); > if (m != NULL) > m_freem(m); > return (0); basically it moves check for bridging to after ipfw stuff. What do you think ? Thank you. -- Andriy Gapon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message