summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2001-08-03 21:13:41 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2001-08-03 21:13:41 +0000
commitced19b191432c0e56e41e7127fe7468f4095d538 (patch)
tree9fadb23cf0082c009c4df8287710b0a7ac5c5afe
parent211fb2de2fe021c677fd2c8d162423fb82f69e69 (diff)
simplify previous fix (0-length mbuf in mbuf chain). from freebsd
-rw-r--r--sys/net/if_tun.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index 3050cbd6a66..1f421e94372 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_tun.c,v 1.37 2001/08/02 22:30:41 itojun Exp $ */
+/* $OpenBSD: if_tun.c,v 1.38 2001/08/03 21:13:40 itojun Exp $ */
/* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */
/*
@@ -534,15 +534,9 @@ tunread(dev, uio, ioflag)
splx(s);
while (m0 && uio->uio_resid > 0 && error == 0) {
- if (m0->m_len == 0) {
- MFREE(m0, m);
- m0 = m;
- continue;
- }
len = min(uio->uio_resid, m0->m_len);
- if (len == 0)
- break;
- error = uiomove(mtod(m0, caddr_t), len, uio);
+ if (len != 0)
+ error = uiomove(mtod(m0, caddr_t), len, uio);
MFREE(m0, m);
m0 = m;
}