Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Oct 1998 17:18:35 +0100 (MET)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        wpaul@skynet.ctr.columbia.edu (Bill Paul)
Cc:        hackers@FreeBSD.ORG, freebsd-hardware@FreeBSD.ORG
Subject:   Re: 2nd call for testers for RealTek 8139 driver
Message-ID:  <199810061618.RAA06850@labinfo.iet.unipi.it>
In-Reply-To: <199809292311.TAA12549@skynet.ctr.columbia.edu> from "Bill Paul" at Sep 29, 98 07:11:31 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> This is another call for testers for the RealTek 8139 fast ethernet
> driver. So far I have only gotten one (1) response to my first call
...

ok, adapting the driver to do bridging was not that hard but now i seem
unable to deal with pkts larger than a few bytes (an mbuf i think):
ping -s 80 does not seem to go through, whereas regular pings work.

I am not sure what is the problem and now it is too late to investigate
more. In any case my diffs are as follows, in case they suggest
something.

	cheers
	luigi

--- if_rl.c.orig	Tue Oct  6 17:29:40 1998
+++ if_rl.c	Tue Oct  6 18:09:03 1998
@@ -121,6 +121,10 @@
 #include <net/bpf.h>
 #endif
 
+#ifdef BRIDGE
+#include <net/bridge.h>
+#endif
+
 #include <vm/vm.h>              /* for vtophys */
 #include <vm/pmap.h>            /* for vtophys */
 #include <machine/clock.h>      /* for DELAY */
@@ -1407,6 +1411,9 @@
 		eh = mtod(m, struct ether_header *);
 		ifp->if_ipackets++;
 
+		m->m_pkthdr.len = m->m_len = total_len;
+		m->m_pkthdr.rcvif = ifp; /* XXX */
+
 #if NBPFILTER > 0
 		/*
 		 * Handle BPF listeners. Let the BPF user see the packet, but
@@ -1414,18 +1421,36 @@
 		 * a broadcast packet, multicast packet, matches our ethernet
 		 * address or the interface is in promiscuous mode.
 		 */
-		if (ifp->if_bpf) {
-			m->m_pkthdr.len = m->m_len = total_len;
+		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)) {
+			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-hardware" in the body of the message



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