Module Name:    src
Committed By:   pooka
Date:           Wed Mar 12 17:49:13 UTC 2014

Modified Files:
        src/sys/rump/net/lib/libvirtif: if_virt.c

Log Message:
When sending, only load mbufs which have a length.  This is especially
useful for fragmented datagrams where the tail of the first packet is
full of nothing.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/rump/net/lib/libvirtif/if_virt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/if_virt.c
diff -u src/sys/rump/net/lib/libvirtif/if_virt.c:1.39 src/sys/rump/net/lib/libvirtif/if_virt.c:1.40
--- src/sys/rump/net/lib/libvirtif/if_virt.c:1.39	Mon Mar  3 13:56:40 2014
+++ src/sys/rump/net/lib/libvirtif/if_virt.c	Wed Mar 12 17:49:13 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_virt.c,v 1.39 2014/03/03 13:56:40 pooka Exp $	*/
+/*	$NetBSD: if_virt.c,v 1.40 2014/03/12 17:49:13 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008, 2013 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.39 2014/03/03 13:56:40 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.40 2014/03/12 17:49:13 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -296,12 +296,15 @@ virtif_start(struct ifnet *ifp)
 		}
 
 		m = m0;
-		for (i = 0; i < LB_SH && m; i++) {
-			io[i].iov_base = mtod(m, void *);
-			io[i].iov_len = m->m_len;
+		for (i = 0; i < LB_SH && m; ) {
+			if (m->m_len) {
+				io[i].iov_base = mtod(m, void *);
+				io[i].iov_len = m->m_len;
+				i++;
+			}
 			m = m->m_next;
 		}
-		if (i == LB_SH)
+		if (i == LB_SH && m)
 			panic("lazy bum");
 		bpf_mtap(ifp, m0);
 

Reply via email to