tap(4) calls ether_input() in context of write(2). Enter network

epoch here.

The tun(4) side doesn't need this, as netisr code will take care.
This commit is contained in:
Gleb Smirnoff 2020-01-23 01:38:51 +00:00
parent a44700782e
commit af614b8e04
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=357009

View File

@ -1778,6 +1778,7 @@ static int
tunwrite_l2(struct tuntap_softc *tp, struct mbuf *m,
struct virtio_net_hdr_mrg_rxbuf *vhdr)
{
struct epoch_tracker et;
struct ether_header *eh;
struct ifnet *ifp;
@ -1808,7 +1809,9 @@ tunwrite_l2(struct tuntap_softc *tp, struct mbuf *m,
/* Pass packet up to parent. */
CURVNET_SET(ifp->if_vnet);
NET_EPOCH_ENTER(et);
(*ifp->if_input)(ifp, m);
NET_EPOCH_EXIT(et);
CURVNET_RESTORE();
/* ibytes are counted in parent */
if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);