diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2001-08-02 22:30:42 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2001-08-02 22:30:42 +0000 |
commit | e8aaba54c3b83823d94d8a939720046c9950dc10 (patch) | |
tree | e8a885045917195e501621cc0ed568a1db97410e /sys/net/if_tun.c | |
parent | f66d186e59f4563e55dba54f3544da03c2f607c0 (diff) |
do not exit loop even if m_len == 0. it is legal to have an mbuf with
m_len == 0 in mbuf chain.
Diffstat (limited to 'sys/net/if_tun.c')
-rw-r--r-- | sys/net/if_tun.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index e93689d2b8b..3050cbd6a66 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tun.c,v 1.36 2001/06/27 06:07:46 kjc Exp $ */ +/* $OpenBSD: if_tun.c,v 1.37 2001/08/02 22:30:41 itojun Exp $ */ /* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */ /* @@ -534,6 +534,11 @@ 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; |