summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/if_lnc.c
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>1999-03-17 16:44:53 +0000
committerluigi <luigi@FreeBSD.org>1999-03-17 16:44:53 +0000
commitf29f19c7578e275f2a6e9880e7a0fa29ad17b8e9 (patch)
treee736287dc4e791daddd66dffb6ba5e02ab1a02f9 /sys/i386/isa/if_lnc.c
parent4be2884249eb602a6c2fc4afe26187935f039eed (diff)
downloadFreeBSD-src-f29f19c7578e275f2a6e9880e7a0fa29ad17b8e9.zip
FreeBSD-src-f29f19c7578e275f2a6e9880e7a0fa29ad17b8e9.tar.gz
MF22... add bridging support to the device drivers. Without this
bridging cannot work on -current/releng3!
Diffstat (limited to 'sys/i386/isa/if_lnc.c')
-rw-r--r--sys/i386/isa/if_lnc.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/sys/i386/isa/if_lnc.c b/sys/i386/isa/if_lnc.c
index 2efa620..2c49cac 100644
--- a/sys/i386/isa/if_lnc.c
+++ b/sys/i386/isa/if_lnc.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_lnc.c,v 1.52 1999/01/31 00:39:20 paul Exp $
+ * $Id: if_lnc.c,v 1.53 1999/01/31 00:44:37 paul Exp $
*/
/*
@@ -92,6 +92,11 @@
#include <net/bpf.h>
#endif
+#include "opt_bdg.h"
+#ifdef BRIDGE
+#include <net/bridge.h>
+#endif
+
#ifdef PC98
#include <machine/clock.h>
#endif
@@ -597,7 +602,7 @@ lnc_rint(struct lnc_softc *sc)
* ethernet and packet headers
*/
head->m_pkthdr.rcvif = &sc->arpcom.ac_if;
- head->m_pkthdr.len = pkt_len - sizeof *eh;
+ head->m_pkthdr.len = pkt_len ;
/*
* BPF expects the ether header to be in the first
@@ -611,7 +616,26 @@ lnc_rint(struct lnc_softc *sc)
#if NBPFILTER > 0
if (sc->arpcom.ac_if.if_bpf)
bpf_mtap(&sc->arpcom.ac_if, head);
-
+#endif
+#ifdef BRIDGE
+ if (do_bridge) {
+ struct ifnet *bdg_ifp ;
+
+ bdg_ifp = bridge_in(head);
+ if (bdg_ifp == BDG_DROP)
+ m_freem(head);
+ else {
+ if (bdg_ifp != BDG_LOCAL)
+ bdg_forward(&head, bdg_ifp);
+ if ( bdg_ifp == BDG_LOCAL ||
+ bdg_ifp == BDG_BCAST ||
+ bdg_ifp == BDG_MCAST )
+ goto getit;
+ else if (head)
+ m_freem(head);
+ }
+ } else
+#endif
/* Check this packet is really for us */
if ((sc->arpcom.ac_if.if_flags & IFF_PROMISC) &&
@@ -620,11 +644,12 @@ lnc_rint(struct lnc_softc *sc)
sizeof(eh->ether_dhost))))
m_freem(head);
else
-#endif
{
+getit:
/* Skip over the ether header */
head->m_data += sizeof *eh;
head->m_len -= sizeof *eh;
+ head->m_pkthdr.len -= sizeof *eh;
ether_input(&sc->arpcom.ac_if, eh, head);
}
OpenPOWER on IntegriCloud