summaryrefslogtreecommitdiffstats
path: root/sys/dev/vr
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1999-09-17 18:25:30 +0000
committerwpaul <wpaul@FreeBSD.org>1999-09-17 18:25:30 +0000
commitf7b8014eb79ba484d605f8b4d727a8c0f7766ad9 (patch)
tree0d38ba2e663a4443a93a96c3773cd963df64f1a0 /sys/dev/vr
parent8afddec372ea41ee4cc17dadb9bb742d08ee7142 (diff)
downloadFreeBSD-src-f7b8014eb79ba484d605f8b4d727a8c0f7766ad9.zip
FreeBSD-src-f7b8014eb79ba484d605f8b4d727a8c0f7766ad9.tar.gz
Patch if_vr to add bridging support.
PR: 12385 Submitted by: lyndon@orthanc.ab.ca
Diffstat (limited to 'sys/dev/vr')
-rw-r--r--sys/dev/vr/if_vr.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/sys/dev/vr/if_vr.c b/sys/dev/vr/if_vr.c
index cae329a..1e47ec1 100644
--- a/sys/dev/vr/if_vr.c
+++ b/sys/dev/vr/if_vr.c
@@ -79,6 +79,11 @@
#include <net/bpf.h>
#endif
+#include "opt_bdg.h"
+#ifdef BRIDGE
+#include <net/bridge.h>
+#endif /* BRIDGE */
+
#include <vm/vm.h> /* for vtophys */
#include <vm/pmap.h> /* for vtophys */
#include <machine/clock.h> /* for DELAY */
@@ -1415,7 +1420,21 @@ static void vr_rxeof(sc)
continue;
}
}
-#endif
+#endif /* NBPF>0 */
+#ifdef BRIDGE
+ if (do_bridge) {
+ struct ifnet *bdg_ifp;
+ bdg_ifp = bridge_in(m);
+ if (bdg_ifp != BDG_LOCAL && bdg_ifp != BDG_DROP)
+ bdg_forward(&m, bdg_ifp);
+ if (((bdg_ifp != BDG_LOCAL) && (bdg_ifp != BDG_BCAST) &&
+ (bdg_ifp != BDG_MCAST)) || bdg_ifp == BDG_DROP) {
+ m_freem(m);
+ continue;
+ }
+ }
+#endif /* BRIDGE */
+
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
ether_input(ifp, eh, m);
OpenPOWER on IntegriCloud