From owner-freebsd-bugs Wed Mar 10 15:50:57 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id E126B15094 for ; Wed, 10 Mar 1999 15:50:15 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.2/8.9.2) id PAA99978; Wed, 10 Mar 1999 15:50:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from quack.kfu.com (quack.kfu.com [170.1.70.2]) by hub.freebsd.org (Postfix) with ESMTP id B9A3C14C80 for ; Wed, 10 Mar 1999 15:44:18 -0800 (PST) (envelope-from nsayer@medusa.kfu.com) Received: from medusa.kfu.com (medusa.kfu.com [170.1.70.5]) by quack.kfu.com (8.8.7/8.8.5) with ESMTP id PAA01798 for ; Wed, 10 Mar 1999 15:44:00 -0800 (PST) Received: (from nsayer@localhost) by medusa.kfu.com (8.8.8/8.8.8) id PAA02956; Wed, 10 Mar 1999 15:43:59 -0800 (PST) (envelope-from nsayer) Message-Id: <199903102343.PAA02956@medusa.kfu.com> Date: Wed, 10 Mar 1999 15:43:59 -0800 (PST) From: Nick Sayer Reply-To: nsayer@quack.kfu.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/10534: if_tx.c bridge patch Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 10534 >Category: kern >Synopsis: if_tx.c bridge patch >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Mar 10 15:50:01 PST 1999 >Closed-Date: >Last-Modified: >Originator: Nick Sayer >Release: FreeBSD 3.1-RELEASE i386 >Organization: Just me >Environment: tx0 interface, #define BRIDGE kernel >Description: Add support for bridging to the TX interface. >How-To-Repeat: >Fix: --- if_tx.c.orig Sun Dec 13 22:32:56 1998 +++ if_tx.c Wed Mar 10 15:40:00 1999 @@ -135,6 +135,11 @@ #include #include + +#ifdef BRIDGE +#include +#endif + #endif #if defined(__FreeBSD__) @@ -908,7 +913,28 @@ bpf_mtap( sc->sc_if.if_bpf, m ); #endif /* __FreeBSD__ */ +#endif /* NBPFILTER */ + +#ifdef BRIDGE + if (do_bridge) { + struct ifnet *bdg_ifp ; + bdg_ifp = bridge_in(m); + if (bdg_ifp == BDG_DROP) { + m_free(m); + continue; /* and drop */ + } + if (bdg_ifp != BDG_LOCAL) + bdg_forward(&m, bdg_ifp); + if (bdg_ifp != BDG_LOCAL && bdg_ifp != BDG_BCAST && + bdg_ifp != BDG_MCAST) { + /* m_free(m); bdg_forward consumed it */ + continue; /* and drop */ + } + /* all others accepted locally */ + } +#endif /* Accept only our packets, broadcasts and multicasts */ +#if NBPFILTER > 0 && !defined(BRIDGE) if( (eh->ether_dhost[0] & 1) == 0 && bcmp(eh->ether_dhost,sc->sc_macaddr,ETHER_ADDR_LEN)){ m_freem(m); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message