From owner-freebsd-net Thu Jan 14 01:18:03 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id BAA12133 for freebsd-net-outgoing; Thu, 14 Jan 1999 01:18:03 -0800 (PST) (envelope-from owner-freebsd-net@FreeBSD.ORG) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id BAA12094; Thu, 14 Jan 1999 01:17:35 -0800 (PST) (envelope-from luigi@labinfo.iet.unipi.it) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id IAA28966; Thu, 14 Jan 1999 08:12:03 +0100 From: Luigi Rizzo Message-Id: <199901140712.IAA28966@labinfo.iet.unipi.it> Subject: rl.c patches for bridging To: wpaul@FreeBSD.ORG, net@FreeBSD.ORG Date: Thu, 14 Jan 1999 08:12:03 +0100 (MET) X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Here are patches for the "rl" driver for bridging. I have tried them on a 2.2.x version of the driver and they seem to work (the first set of #include's may be a 2.2.x'ism because of the mislocation of things like ETHERMTU etc, i am going to try this on 3.x to see how it works. cheers luigi --- src/sys/pci/if_rl.c Thu Dec 24 19:39:48 1998 +++ /sys/pci/if_rl.c Thu Jan 14 07:43:58 1999 @@ -99,16 +99,23 @@ #include #include +#include +#include +#include +#include +#include + #if NBPFILTER > 0 #include #endif +#ifdef BRIDGE +#include +#endif + #include /* for vtophys */ #include /* for vtophys */ #include /* for DELAY */ @@ -1392,17 +1438,37 @@ * a broadcast packet, multicast packet, matches our ethernet * address or the interface is in promiscuous mode. */ - if (ifp->if_bpf) { + if (ifp->if_bpf) bpf_mtap(ifp, m); +#endif +#ifdef BRIDGE + if (do_bridge) { + struct ifnet *bdg_ifp ; + bdg_ifp = bridge_in(m); + if (bdg_ifp == BDG_DROP) + goto dropit; + else { + if (bdg_ifp != BDG_LOCAL) + bdg_forward(&m, bdg_ifp); + if (!m) + goto dropit ; + if (bdg_ifp == BDG_LOCAL || bdg_ifp == BDG_BCAST || + bdg_ifp == BDG_MCAST) + goto getit ; + else if (m) + goto dropit ; + } + } else +#endif if (ifp->if_flags & IFF_PROMISC && (bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr, ETHER_ADDR_LEN) && (eh->ether_dhost[0] & 1) == 0)) { +dropit: m_freem(m); continue; } - } -#endif +getit: /* Remove header from mbuf and pass it on. */ m_adj(m, sizeof(struct ether_header)); ether_input(ifp, eh, m); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message