Patch if_vr to add bridging support.

PR:		12385
Submitted by:	lyndon@orthanc.ab.ca
This commit is contained in:
Bill Paul 1999-09-17 18:25:30 +00:00
parent d1e8f983ef
commit 28b50861e7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=51354
2 changed files with 40 additions and 2 deletions

View File

@ -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);

View File

@ -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);