diff options
author | Marko Zec <zec@FreeBSD.org> | 2023-09-23 08:56:56 +0000 |
---|---|---|
committer | Marko Zec <zec@FreeBSD.org> | 2023-09-23 08:56:56 +0000 |
commit | 03ef737c544d3dd90a0000c18382db99ccf2ee9a (patch) | |
tree | 6c176ec6e9b935cceb50b97d3d8dea8748467d79 | |
parent | f9df609750876be2c054dfac953316f513ccffce (diff) | |
download | src-03ef737c544d3dd90a0000c18382db99ccf2ee9a.tar.gz src-03ef737c544d3dd90a0000c18382db99ccf2ee9a.zip |
ng_eiface: switch VNETs when injecting mbufs into netgraph
A ng_eiface instance may be on lease to a different vnet while
remaining tied to its parent vnet. In such circumstances, before
injecting mbufs into netgraph, curvnet must be set to that of the
ng_eiface's netgraph node. Mark the vnet transition as QUIET,
since otherwise it would be recorded as a curvnet recursion when
ng_eiface's ifnet resides in the same (parent) vnet as its
netgraph node.
PR: 274028
Reported by: Dancho Penev <dpslavov@hotmail.com>
MFC after: 1 week
-rw-r--r-- | sys/netgraph/ng_eiface.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/netgraph/ng_eiface.c b/sys/netgraph/ng_eiface.c index 40b1a1128de8..a35650f15edd 100644 --- a/sys/netgraph/ng_eiface.c +++ b/sys/netgraph/ng_eiface.c @@ -257,7 +257,9 @@ ng_eiface_start2(node_p node, hook_p hook, void *arg1, int arg2) * freed. */ NG_OUTBOUND_THREAD_REF(); + CURVNET_SET_QUIET(priv->node->nd_vnet); NG_SEND_DATA_ONLY(error, priv->ether, m); + CURVNET_RESTORE(); NG_OUTBOUND_THREAD_UNREF(); /* Update stats */ |