Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Apr 2000 16:55:05 -0700 (PDT)
From:      Nick Sayer <nsayer@quack.kfu.com>
To:        freebsd-hackers@freebsd.org, freebsd-mobile@freebsd.org
Subject:   RFC: if_wi.c bridging patch
Message-ID:  <200004132355.QAA70429@medusa.kfu.com>

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

I have had some wi cards for a while, and while I have managed to get
an Airport to work (a friend helped me out), I believe that adding wi
to the list of bridge compatible interfaces may be helpful.

According to the documentation, the IBSS mode of the driver doesn't
work. That's too bad, as in combination with this patch, you could
make your own "airport" this way. IBSS is desirable because it allows
power management mode to work on the BSS client machines. C'est la
guerre.

I don't have a wi in a position that is comfortable for me to test.
But if someone can verify that this works, I will commit it.

This is relative to RELENG_4.

--- if_wi.c.orig	Thu Apr 13 16:36:37 2000
+++ if_wi.c	Thu Apr 13 16:48:53 2000
@@ -102,6 +102,10 @@
 
 #include <net/bpf.h>
 
+#ifdef BRIDGE
+#include <net/bridge.h>
+#endif
+
 #include <machine/if_wavelan_ieee.h>
 #include <i386/isa/if_wireg.h>
 
@@ -425,8 +429,31 @@
 	ifp->if_ipackets++;
 
 	/* Handle BPF listeners. */
-	if (ifp->if_bpf) {
+	if (ifp->if_bpf)
 		bpf_mtap(ifp, m);
+
+#ifdef BRIDGE
+	if (do_bridge) {
+		struct ifnet *bdg_ifp;
+		bdg_ifp = bridge_in(m);
+		if (bdg_ifp == BDG_DROP) {
+			if (m)
+				m_free(m);
+			return; /* and drop */
+		}
+		if (bdg_ifp != BDG_LOCAL)
+			bdg_forward(&m, bdg_ifp);
+		if (bdg_ifp != BDG_LOCAL && bdg_ifp != BDG_BCAST &&
+			bdg_ifp != BDG_MCAST) {
+			if (m)
+				m_free(m);
+			return; /* and drop */
+		}
+		/* all others accepted locally */
+	}
+	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)) {


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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