|
Lines 79-84
Link Here
|
| 79 |
#include <net/bpf.h> |
79 |
#include <net/bpf.h> |
| 80 |
#endif |
80 |
#endif |
| 81 |
|
81 |
|
|
|
82 |
#include "opt_bdg.h" |
| 83 |
#ifdef BRIDGE |
| 84 |
#include <net/bridge.h> |
| 85 |
#endif |
| 86 |
|
| 82 |
#include <vm/vm.h> /* for vtophys */ |
87 |
#include <vm/vm.h> /* for vtophys */ |
| 83 |
#include <vm/pmap.h> /* for vtophys */ |
88 |
#include <vm/pmap.h> /* for vtophys */ |
| 84 |
#include <machine/clock.h> /* for DELAY */ |
89 |
#include <machine/clock.h> /* for DELAY */ |
|
Lines 1318-1339
Link Here
|
| 1318 |
m->m_pkthdr.len = m->m_len = total_len; |
1323 |
m->m_pkthdr.len = m->m_len = total_len; |
| 1319 |
#if NBPFILTER > 0 |
1324 |
#if NBPFILTER > 0 |
| 1320 |
/* |
1325 |
/* |
| 1321 |
* Handle BPF listeners. Let the BPF user see the packet, but |
1326 |
* Handle BPF listeners. Let the BPF user see the packet. |
| 1322 |
* don't pass it up to the ether_input() layer unless it's |
|
|
| 1323 |
* a broadcast packet, multicast packet, matches our ethernet |
| 1324 |
* address or the interface is in promiscuous mode. |
| 1325 |
*/ |
1327 |
*/ |
| 1326 |
if (ifp->if_bpf) { |
1328 |
if (ifp->if_bpf) |
| 1327 |
bpf_mtap(ifp, m); |
1329 |
bpf_mtap(ifp, m); |
| 1328 |
if (ifp->if_flags & IFF_PROMISC && |
1330 |
#endif |
| 1329 |
(bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr, |
1331 |
#ifdef BRIDGE /* see code in if_ed.c */ |
| 1330 |
ETHER_ADDR_LEN) && |
1332 |
if (do_bridge) { |
| 1331 |
(eh->ether_dhost[0] & 1) == 0)) { |
1333 |
struct ifnet *bdg_ifp ; |
|
|
1334 |
bdg_ifp = bridge_in(m); |
| 1335 |
if (bdg_ifp == BDG_DROP) { |
| 1332 |
m_freem(m); |
1336 |
m_freem(m); |
| 1333 |
continue; |
1337 |
continue; |
| 1334 |
} |
1338 |
} |
|
|
1339 |
if (bdg_ifp != BDG_LOCAL) |
| 1340 |
bdg_forward(&m, bdg_ifp); |
| 1341 |
if (bdg_ifp != BDG_LOCAL && bdg_ifp != BDG_BCAST && |
| 1342 |
bdg_ifp != BDG_MCAST) { |
| 1343 |
/* not local and not multicast, just drop it */ |
| 1344 |
if (m) |
| 1345 |
m_freem(m); |
| 1346 |
continue; |
| 1347 |
} |
| 1348 |
/* all others accepted locally */ |
| 1335 |
} |
1349 |
} |
| 1336 |
#endif |
1350 |
#endif |
|
|
1351 |
/* |
| 1352 |
* Don't pass it up to the ether_input() layer unless it's |
| 1353 |
* a broadcast packet, multicast packet, matches our ethernet |
| 1354 |
* address or the interface is in promiscuous mode. |
| 1355 |
*/ |
| 1356 |
if (ifp->if_flags & IFF_PROMISC && |
| 1357 |
(bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr, |
| 1358 |
ETHER_ADDR_LEN) && |
| 1359 |
(eh->ether_dhost[0] & 1) == 0)) { |
| 1360 |
m_freem(m); |
| 1361 |
continue; |
| 1362 |
} |
| 1337 |
/* Remove header from mbuf and pass it on. */ |
1363 |
/* Remove header from mbuf and pass it on. */ |
| 1338 |
m_adj(m, sizeof(struct ether_header)); |
1364 |
m_adj(m, sizeof(struct ether_header)); |
| 1339 |
ether_input(ifp, eh, m); |
1365 |
ether_input(ifp, eh, m); |