From owner-freebsd-hackers Thu Apr 13 16:55:45 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from quack.kfu.com (quack.kfu.com [170.1.70.2]) by hub.freebsd.org (Postfix) with ESMTP id AD78A37B7D1; Thu, 13 Apr 2000 16:55:36 -0700 (PDT) (envelope-from nsayer@medusa.kfu.com) Received: from medusa.kfu.com (medusa.kfu.com [170.1.70.5]) by quack.kfu.com (8.9.2/8.9.3) with ESMTP id QAA32270; Thu, 13 Apr 2000 16:55:35 -0700 (PDT) (envelope-from nsayer@medusa.kfu.com) Received: (from nsayer@localhost) by medusa.kfu.com (8.9.3/8.8.8) id QAA70429; Thu, 13 Apr 2000 16:55:05 -0700 (PDT) (envelope-from nsayer) Date: Thu, 13 Apr 2000 16:55:05 -0700 (PDT) From: Nick Sayer Message-Id: <200004132355.QAA70429@medusa.kfu.com> To: freebsd-hackers@freebsd.org, freebsd-mobile@freebsd.org Subject: RFC: if_wi.c bridging patch Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 +#ifdef BRIDGE +#include +#endif + #include #include @@ -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