Don't complain if 0 bytes are written to the tun device, simply

do nothing.
This commit is contained in:
Brian Somers 1999-07-26 12:11:10 +00:00
parent a42377eaa1
commit 3145c58d33
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=49116

View file

@ -590,7 +590,10 @@ tunwrite(dev, uio, flag)
TUNDEBUG("%s%d: tunwrite\n", ifp->if_name, ifp->if_unit);
if (uio->uio_resid <= 0 || uio->uio_resid > TUNMRU) {
if (uio->uio_resid == 0)
return 0;
if (uio->uio_resid < 0 || uio->uio_resid > TUNMRU) {
TUNDEBUG("%s%d: len=%d!\n", ifp->if_name, ifp->if_unit,
uio->uio_resid);
return EIO;