summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian <brian@cvs.openbsd.org>1999-07-24 03:18:33 +0000
committerbrian <brian@cvs.openbsd.org>1999-07-24 03:18:33 +0000
commit7f2d908da2f6727a325f1cfeffeb323ce861294e (patch)
tree4c4308de5f890d6f5cc184041ae6aff585fb5528
parentc5927383e2dc5316aa4428bd8645368628b12f41 (diff)
Return EMSGSIZE for zero length writes - don't panic.
-rw-r--r--sys/net/if_tun.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index 2b1cb7e95e6..6beafcb183a 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_tun.c,v 1.25 1999/04/22 20:02:44 art Exp $ */
+/* $OpenBSD: if_tun.c,v 1.26 1999/07/24 03:18:32 brian Exp $ */
/* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */
/*
@@ -554,7 +554,7 @@ tunwrite(dev, uio, ioflag)
ifp = &tunctl[unit].tun_if;
TUNDEBUG(("%s: tunwrite\n", ifp->if_xname));
- if (uio->uio_resid < 0 || uio->uio_resid > TUNMRU) {
+ if (uio->uio_resid == 0 || uio->uio_resid > TUNMRU) {
TUNDEBUG(("%s: len=%d!\n", ifp->if_xname, uio->uio_resid));
return EMSGSIZE;
}