Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if_bridge.c
Show First 20 Lines • Show All 2,442 Lines • ▼ Show 20 Lines | if (bif->bif_flags & IFBIF_LEARNING) { \ | ||||
if (error && bif->bif_addrmax) { \ | if (error && bif->bif_addrmax) { \ | ||||
BRIDGE_UNLOCK(sc); \ | BRIDGE_UNLOCK(sc); \ | ||||
m_freem(m); \ | m_freem(m); \ | ||||
return (NULL); \ | return (NULL); \ | ||||
} \ | } \ | ||||
} \ | } \ | ||||
m->m_pkthdr.rcvif = iface; \ | m->m_pkthdr.rcvif = iface; \ | ||||
BRIDGE_UNLOCK(sc); \ | BRIDGE_UNLOCK(sc); \ | ||||
/* \ | |||||
* These mbufs will not have another chance to get sent \ | |||||
* to bpf elsewhere in the stack as being received \ | |||||
* by this interface, because they are coming in over \ | |||||
* the bridge. They likely have been accounted for \ | |||||
* when received by the interface that they came from, \ | |||||
* but this is not enough for other consumers, \ | |||||
* e.g. dhclient, to be satisfied. \ | |||||
* \ | |||||
* rcvif needs to be set on the mbuf here, lest we risk \ | |||||
* losing the mbuf as a "duplicate" because it's \ | |||||
* considered outgoing by bpf. \ | |||||
*/ \ | |||||
if ((iface)->if_type != IFT_BRIDGE && \ | |||||
(iface)->if_bpf != NULL && (iface) != ifp) \ | |||||
ETHER_BPF_MTAP(iface, m); \ | |||||
return (m); \ | return (m); \ | ||||
} \ | } \ | ||||
\ | \ | ||||
/* We just received a packet that we sent out. */ \ | /* We just received a packet that we sent out. */ \ | ||||
if (memcmp(IF_LLADDR((iface)), eh->ether_shost, ETHER_ADDR_LEN) == 0 \ | if (memcmp(IF_LLADDR((iface)), eh->ether_shost, ETHER_ADDR_LEN) == 0 \ | ||||
OR_CARP_CHECK_WE_ARE_SRC((iface)) \ | OR_CARP_CHECK_WE_ARE_SRC((iface)) \ | ||||
) { \ | ) { \ | ||||
BRIDGE_UNLOCK(sc); \ | BRIDGE_UNLOCK(sc); \ | ||||
▲ Show 20 Lines • Show All 1,146 Lines • Show Last 20 Lines |