Index: if_tun.c =================================================================== RCS file: /cvs/src/sys/net/if_tun.c,v retrieving revision 1.231 diff -u -p -r1.231 if_tun.c --- if_tun.c 9 Mar 2021 20:05:14 -0000 1.231 +++ if_tun.c 18 Jan 2022 12:04:26 -0000 @@ -815,13 +815,25 @@ put: int tunwrite(dev_t dev, struct uio *uio, int ioflag) { - return (tun_dev_write(dev, uio, ioflag, 0)); + int rv; + + KERNEL_UNLOCK(); + rv = tun_dev_write(dev, uio, ioflag, 0); + KERNEL_LOCK(); + + return (rv); } int tapwrite(dev_t dev, struct uio *uio, int ioflag) { - return (tun_dev_write(dev, uio, ioflag, ETHER_ALIGN)); + int rv; + + KERNEL_UNLOCK(); + rv = tun_dev_write(dev, uio, ioflag, ETHER_ALIGN); + KERNEL_LOCK(); + + return (rv); } int