diff options
author | brian <brian@FreeBSD.org> | 1999-07-26 12:11:10 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1999-07-26 12:11:10 +0000 |
commit | 59e80c5711190ee0d3d304625b691c139e2bae27 (patch) | |
tree | 5c0f98fa29f57e4a148c8286a4878a4c44289488 /sys/net/if_tun.c | |
parent | a898a62153c6ad7ef4e8bd14eec904194af426bf (diff) | |
download | FreeBSD-src-59e80c5711190ee0d3d304625b691c139e2bae27.zip FreeBSD-src-59e80c5711190ee0d3d304625b691c139e2bae27.tar.gz |
Don't complain if 0 bytes are written to the tun device, simply
do nothing.
Diffstat (limited to 'sys/net/if_tun.c')
-rw-r--r-- | sys/net/if_tun.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 6e8c479..16542de 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -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; |