summaryrefslogtreecommitdiffstats
path: root/sys/net/if_tun.c
diff options
context:
space:
mode:
authorjmg <jmg@FreeBSD.org>1999-07-23 20:08:27 +0000
committerjmg <jmg@FreeBSD.org>1999-07-23 20:08:27 +0000
commitaa93e6cc7f601a09a6bd74505988524619e53948 (patch)
tree1df62ffad2bbe2c427803cebc4cef1c1890f1a6d /sys/net/if_tun.c
parente4620300d62667d571e600e6ecb2f9612cd79c16 (diff)
downloadFreeBSD-src-aa93e6cc7f601a09a6bd74505988524619e53948.zip
FreeBSD-src-aa93e6cc7f601a09a6bd74505988524619e53948.tar.gz
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...
Diffstat (limited to 'sys/net/if_tun.c')
-rw-r--r--sys/net/if_tun.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index 4d1d2cc..6e8c479 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -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;
OpenPOWER on IntegriCloud