Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if_ethersubr.c
Show First 20 Lines • Show All 598 Lines • ▼ Show 20 Lines | #endif | ||||
if (ifp->if_bridge != NULL) { | if (ifp->if_bridge != NULL) { | ||||
m->m_flags &= ~M_PROMISC; | m->m_flags &= ~M_PROMISC; | ||||
BRIDGE_INPUT(ifp, m); | BRIDGE_INPUT(ifp, m); | ||||
if (m == NULL) { | if (m == NULL) { | ||||
CURVNET_RESTORE(); | CURVNET_RESTORE(); | ||||
return; | return; | ||||
} | } | ||||
eh = mtod(m, struct ether_header *); | eh = mtod(m, struct ether_header *); | ||||
} | } else { | ||||
#if defined(INET) || defined(INET6) | #if defined(INET) || defined(INET6) | ||||
/* | /* | ||||
* Clear M_PROMISC on frame so that carp(4) will see it when the | * Clear M_PROMISC on frame so that carp(4) will see it when the | ||||
* mbuf flows up to Layer 3. | * mbuf flows up to Layer 3. | ||||
* FreeBSD's implementation of carp(4) uses the inprotosw | * FreeBSD's implementation of carp(4) uses the inprotosw | ||||
* to dispatch IPPROTO_CARP. carp(4) also allocates its own | * to dispatch IPPROTO_CARP. carp(4) also allocates its own | ||||
* Ethernet addresses of the form 00:00:5e:00:01:xx, which | * Ethernet addresses of the form 00:00:5e:00:01:xx, which | ||||
* is outside the scope of the M_PROMISC test below. | * is outside the scope of the M_PROMISC test below. | ||||
gnn: I am confused by this additional else. It looks like it won't compile but maybe phabricator is… | |||||
Done Inline ActionsNo probably i forgot to properly indent this one, its correct. eri: No probably i forgot to properly indent this one, its correct.
It basically skips checks that… | |||||
* TODO: Maintain a hash table of ethernet addresses other than | * TODO: Maintain a hash table of ethernet addresses other than | ||||
* ether_dhost which may be active on this ifp. | * ether_dhost which may be active on this ifp. | ||||
*/ | */ | ||||
if (ifp->if_carp && (*carp_forus_p)(ifp, eh->ether_dhost)) { | if (ifp->if_carp && (*carp_forus_p)(ifp, eh->ether_dhost)) { | ||||
m->m_flags &= ~M_PROMISC; | m->m_flags &= ~M_PROMISC; | ||||
} else | } else | ||||
#endif | #endif | ||||
{ | { | ||||
/* | /* | ||||
* If the frame received was not for our MAC address, set the | * If the frame received was not for our MAC address, set the | ||||
* M_PROMISC flag on the mbuf chain. The frame may need to | * M_PROMISC flag on the mbuf chain. The frame may need to | ||||
* be seen by the rest of the Ethernet input path in case of | * be seen by the rest of the Ethernet input path in case of | ||||
* re-entry (e.g. bridge, vlan, netgraph) but should not be | * re-entry (e.g. bridge, vlan, netgraph) but should not be | ||||
* seen by upper protocol layers. | * seen by upper protocol layers. | ||||
*/ | */ | ||||
if (!ETHER_IS_MULTICAST(eh->ether_dhost) && | if (!ETHER_IS_MULTICAST(eh->ether_dhost) && | ||||
bcmp(IF_LLADDR(ifp), eh->ether_dhost, ETHER_ADDR_LEN) != 0) | bcmp(IF_LLADDR(ifp), eh->ether_dhost, ETHER_ADDR_LEN) != 0) | ||||
m->m_flags |= M_PROMISC; | m->m_flags |= M_PROMISC; | ||||
} | |||||
} | } | ||||
ether_demux(ifp, m); | ether_demux(ifp, m); | ||||
CURVNET_RESTORE(); | CURVNET_RESTORE(); | ||||
} | } | ||||
/* | /* | ||||
* Ethernet input dispatch; by default, direct dispatch here regardless of | * Ethernet input dispatch; by default, direct dispatch here regardless of | ||||
▲ Show 20 Lines • Show All 601 Lines • Show Last 20 Lines |
I am confused by this additional else. It looks like it won't compile but maybe phabricator is confused?