fix a problem w/ zero byte writes to the tunnel device. It would bypass

the loop and not set an error, so we would then try to access an invalid
mbuf...

PR:		12780
Submitted by:	bright@rush.net aka zb^3

a new record in length a pr was open... only about a half hour...
This commit is contained in:
John-Mark Gurney 1999-07-23 20:08:27 +00:00
parent 571a80b261
commit 37735ca6ea

View File

@ -590,7 +590,7 @@ 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 || uio->uio_resid > TUNMRU) {
TUNDEBUG("%s%d: len=%d!\n", ifp->if_name, ifp->if_unit,
uio->uio_resid);
return EIO;