diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2001-08-03 21:13:41 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2001-08-03 21:13:41 +0000 |
commit | ced19b191432c0e56e41e7127fe7468f4095d538 (patch) | |
tree | 9fadb23cf0082c009c4df8287710b0a7ac5c5afe /sys/net | |
parent | 211fb2de2fe021c677fd2c8d162423fb82f69e69 (diff) |
simplify previous fix (0-length mbuf in mbuf chain). from freebsd
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_tun.c | 12 |
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; } |