diff options
author | 2001-08-03 21:13:40 +0000 | |
---|---|---|
committer | 2001-08-03 21:13:40 +0000 | |
commit | be33b05d650e9a69186d18b069cd6796d78380d6 (patch) | |
tree | 42e78423e03538806e2f1496c6ac0e0bc024edf8 | |
parent | typo; krapht@secureops.com (diff) | |
download | wireguard-openbsd-be33b05d650e9a69186d18b069cd6796d78380d6.tar.xz wireguard-openbsd-be33b05d650e9a69186d18b069cd6796d78380d6.zip |
simplify previous fix (0-length mbuf in mbuf chain). from freebsd
-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; } |