Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Jun 1999 00:53:28 -0600 (MDT)
From:      Lyndon Nerenberg <lyndon@orthanc.ab.ca>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/12385: Patch to add bridging support to if_vr.c
Message-ID:  <199906250653.AAA00542@orthanc.ab.ca>

next in thread | raw e-mail | index | archive | help

>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 <pci/if_vrreg.h>
 
+#include "opt_bdg.h"
+#ifdef BRIDGE
+#include <net/bridge.h>
+#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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199906250653.AAA00542>