Date: Wed, 10 Mar 1999 15:43:59 -0800 (PST) From: Nick Sayer <nsayer@quack.kfu.com> To: FreeBSD-gnats-submit@freebsd.org Subject: kern/10534: if_tx.c bridge patch Message-ID: <199903102343.PAA02956@medusa.kfu.com>
index | next in thread | raw e-mail
>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 <pci/pcivar.h>
#include <pci/if_txvar.h>
+
+#ifdef BRIDGE
+#include <net/bridge.h>
+#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
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199903102343.PAA02956>
