From owner-freebsd-bugs Fri Jun 25 0: 0: 8 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 94A9214CFD for ; Fri, 25 Jun 1999 00:00:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id AAA24107; Fri, 25 Jun 1999 00:00:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from orthanc.ab.ca (orthanc.ab.ca [207.167.3.130]) by hub.freebsd.org (Postfix) with ESMTP id 587A114BE0 for ; Thu, 24 Jun 1999 23:53:29 -0700 (PDT) (envelope-from lyndon@orthanc.ab.ca) Received: (from lyndon@localhost) by orthanc.ab.ca (8.9.3/8.9.3) id AAA00542; Fri, 25 Jun 1999 00:53:28 -0600 (MDT) (envelope-from lyndon) Message-Id: <199906250653.AAA00542@orthanc.ab.ca> Date: Fri, 25 Jun 1999 00:53:28 -0600 (MDT) From: Lyndon Nerenberg Reply-To: lyndon@orthanc.ab.ca To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/12385: Patch to add bridging support to if_vr.c Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 12385 >Category: kern >Synopsis: Patch to add bridging support to if_vr.c >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Jun 25 00:00:01 PDT 1999 >Closed-Date: >Last-Modified: >Originator: >Release: FreeBSD 4.0-CURRENT i386 >Organization: The Frobozz Magic Homing Pigeon Company >Environment: >Description: The enclosed patch adds bridging support for the VIA Rhine Ethernet (vr) driver. My apologies for the egregious indentation changes; emacs decided to take over, and it's too late in the evening for me to fight with it :-P >How-To-Repeat: >Fix: --- /sys/pci/if_vr.c 1999/06/25 06:13:08 1.1 +++ /sys/pci/if_vr.c 1999/06/25 06:33:11 @@ -95,6 +95,11 @@ #include +#include "opt_bdg.h" +#ifdef BRIDGE +#include +#endif /* BRIDGE */ + #ifndef lint static const char rcsid[] = "$Id: if_vr.c,v 1.1 1999/06/25 06:13:08 lyndon Exp lyndon $"; @@ -1323,8 +1328,32 @@ * 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 /* NBPFILTER */ +#ifdef BRIDGE + if (do_bridge) { + + struct ifnet *bdg_ifp; + + bdg_ifp = bridge_in(m); + if (bdg_ifp == BDG_DROP) + goto dropit ; + if (bdg_ifp != BDG_LOCAL) + bdg_forward(&m, bdg_ifp); + if (bdg_ifp != BDG_LOCAL && + bdg_ifp != BDG_BCAST && + bdg_ifp != BDG_MCAST) + goto dropit ; + goto getit ; + } +#endif + /* Only pass this up if it's for us. */ + +#ifdef BRIDGE +dropit: +#endif /* BRIDGE */ + if (ifp->if_flags & IFF_PROMISC && (bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr, ETHER_ADDR_LEN) && @@ -1332,8 +1361,11 @@ m_freem(m); continue; } - } -#endif + +#ifdef BRIDGE +getit: +#endif /* BRIDGE*/ + /* Remove header from mbuf and pass it on. */ m_adj(m, sizeof(struct ether_header)); ether_input(ifp, eh, m); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message