Index: if.c =================================================================== RCS file: /cvs/src/sys/net/if.c,v retrieving revision 1.602 diff -u -p -r1.602 if.c --- if.c 11 Apr 2020 10:49:27 -0000 1.602 +++ if.c 12 Apr 2020 01:58:07 -0000 @@ -951,6 +951,9 @@ if_vinput(struct ifnet *ifp, struct mbuf caddr_t if_bpf; #endif + /* require the same locking that if_input_process provides */ + NET_ASSERT_LOCKED(); + m->m_pkthdr.ph_ifidx = ifp->if_index; m->m_pkthdr.ph_rtableid = ifp->if_rdomain; Index: if_tun.c =================================================================== RCS file: /cvs/src/sys/net/if_tun.c,v retrieving revision 1.220 diff -u -p -r1.220 if_tun.c --- if_tun.c 7 Apr 2020 13:27:52 -0000 1.220 +++ if_tun.c 12 Apr 2020 01:58:07 -0000 @@ -866,9 +866,9 @@ tun_dev_write(dev_t dev, struct uio *uio if (error != 0) goto drop; - NET_RLOCK(); + NET_LOCK(); if_vinput(ifp, m0); - NET_RUNLOCK(); + NET_UNLOCK(); tun_put(sc); return (0);