Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net do not break from loop even if m_len == 0. it's val...



details:   https://anonhg.NetBSD.org/src/rev/b40c82466e20
branches:  trunk
changeset: 513506:b40c82466e20
user:      itojun <itojun%NetBSD.org@localhost>
date:      Thu Aug 02 13:37:51 2001 +0000

description:
do not break from loop even if m_len == 0.  it's valid to have
mbuf with m_len == 0 in mbuf chain.

diffstat:

 sys/net/if_tun.c |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (21 lines):

diff -r 1923691fa022 -r b40c82466e20 sys/net/if_tun.c
--- a/sys/net/if_tun.c  Thu Aug 02 12:41:39 2001 +0000
+++ b/sys/net/if_tun.c  Thu Aug 02 13:37:51 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_tun.c,v 1.43 2001/04/13 23:30:18 thorpej Exp $      */
+/*     $NetBSD: if_tun.c,v 1.44 2001/08/02 13:37:51 itojun Exp $       */
 
 /*
  * Copyright (c) 1988, Julian Onions <jpo%cs.nott.ac.uk@localhost>
@@ -511,6 +511,11 @@
        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;



Home | Main Index | Thread Index | Old Index