summaryrefslogtreecommitdiffstats
path: root/sys/dev/fxp
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/dev/fxp
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/dev/fxp')
-rw-r--r--sys/dev/fxp/if_fxp.c61
1 files changed, 43 insertions, 18 deletions
diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c
index 79032ac..6568929 100644
--- a/sys/dev/fxp/if_fxp.c
+++ b/sys/dev/fxp/if_fxp.c
@@ -27,7 +27,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_fxp.c,v 1.63 1999/02/11 21:47:09 julian Exp $
+ * $Id: if_fxp.c,v 1.64 1999/02/12 17:56:23 julian Exp $
*/
/*
@@ -103,6 +103,12 @@
#endif /* __NetBSD__ */
+#include "opt_bdg.h"
+#ifdef BRIDGE
+#include <net/if_types.h>
+#include <net/bridge.h>
+#endif
+
/*
* NOTE! On the Alpha, we have an alignment constraint. The
* card DMAs the packet immediately following the RFA. However,
@@ -1010,31 +1016,50 @@ rcvloop:
}
m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = m->m_len =
- total_len -
- sizeof(struct ether_header);
+ total_len ;
eh = mtod(m, struct ether_header *);
#if NBPFILTER > 0
- if (ifp->if_bpf) {
+ if (ifp->if_bpf)
bpf_tap(FXP_BPFTAP_ARG(ifp),
mtod(m, caddr_t),
total_len);
- /*
- * Only pass this packet up
- * if it is for us.
- */
- if ((ifp->if_flags &
- IFF_PROMISC) &&
- (rfa->rfa_status &
- FXP_RFA_STATUS_IAMATCH) &&
- (eh->ether_dhost[0] & 1)
- == 0) {
- m_freem(m);
- goto rcvloop;
- }
- }
#endif /* NBPFILTER > 0 */
+#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 packet up
+ * if it is for us.
+ */
+ if ((ifp->if_flags &
+ IFF_PROMISC) &&
+ (rfa->rfa_status &
+ FXP_RFA_STATUS_IAMATCH) &&
+ (eh->ether_dhost[0] & 1)
+ == 0) {
+dropit:
+ if (m)
+ m_freem(m);
+ goto rcvloop;
+ }
+getit:
m->m_data +=
sizeof(struct ether_header);
+ m->m_len -=
+ sizeof(struct ether_header);
+ m->m_pkthdr.len = m->m_len ;
ether_input(ifp, eh, m);
}
goto rcvloop;
OpenPOWER on IntegriCloud