Changeset View
Changeset View
Standalone View
Standalone View
sys/netgraph/ng_ether.c
Show First 20 Lines • Show All 706 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
/* | /* | ||||
* Handle an mbuf received on the "upper" hook. | * Handle an mbuf received on the "upper" hook. | ||||
*/ | */ | ||||
static int | static int | ||||
ng_ether_rcv_upper(hook_p hook, item_p item) | ng_ether_rcv_upper(hook_p hook, item_p item) | ||||
{ | { | ||||
struct epoch_tracker et; | |||||
struct mbuf *m; | struct mbuf *m; | ||||
const node_p node = NG_HOOK_NODE(hook); | const node_p node = NG_HOOK_NODE(hook); | ||||
const priv_p priv = NG_NODE_PRIVATE(node); | const priv_p priv = NG_NODE_PRIVATE(node); | ||||
struct ifnet *ifp = priv->ifp; | struct ifnet *ifp = priv->ifp; | ||||
NGI_GET_M(item, m); | NGI_GET_M(item, m); | ||||
NG_FREE_ITEM(item); | NG_FREE_ITEM(item); | ||||
/* Check length and pull off header */ | /* Check length and pull off header */ | ||||
if (m->m_pkthdr.len < sizeof(struct ether_header)) { | if (m->m_pkthdr.len < sizeof(struct ether_header)) { | ||||
NG_FREE_M(m); | NG_FREE_M(m); | ||||
return (EINVAL); | return (EINVAL); | ||||
} | } | ||||
if (m->m_len < sizeof(struct ether_header) && | if (m->m_len < sizeof(struct ether_header) && | ||||
(m = m_pullup(m, sizeof(struct ether_header))) == NULL) | (m = m_pullup(m, sizeof(struct ether_header))) == NULL) | ||||
return (ENOBUFS); | return (ENOBUFS); | ||||
m->m_pkthdr.rcvif = ifp; | m->m_pkthdr.rcvif = ifp; | ||||
/* Pass the packet to the bridge, it may come back to us */ | /* Pass the packet to the bridge, it may come back to us */ | ||||
glebius: This epoch entrance after /* Route packet back in */ was added by myself in r353292. Now that… | |||||
if (ifp->if_bridge) { | if (ifp->if_bridge) { | ||||
BRIDGE_INPUT(ifp, m); | BRIDGE_INPUT(ifp, m); | ||||
if (m == NULL) | if (m == NULL) | ||||
return (0); | return (0); | ||||
} | } | ||||
/* Route packet back in */ | /* Route packet back in */ | ||||
NET_EPOCH_ENTER(et); | |||||
ether_demux(ifp, m); | ether_demux(ifp, m); | ||||
NET_EPOCH_EXIT(et); | |||||
return (0); | return (0); | ||||
} | } | ||||
/* | /* | ||||
* Shutdown node. This resets the node but does not remove it | * Shutdown node. This resets the node but does not remove it | ||||
* unless the REALLY_DIE flag is set. | * unless the REALLY_DIE flag is set. | ||||
*/ | */ | ||||
static int | static int | ||||
▲ Show 20 Lines • Show All 130 Lines • Show Last 20 Lines |
This epoch entrance after /* Route packet back in */ was added by myself in r353292. Now that ng_socket and other entrance nodes are fixed, I'm not sure it is still needed. Of course your patch makes it more consistent - covering BRIDGE_INPUT, too.
Have you tested with this NET_EPOCH_ENTER removed but with ng_pppoe_rcvmsg() epoch in place?