Module Name:    src
Committed By:   pooka
Date:           Fri Jun 14 05:56:29 UTC 2013

Modified Files:
        src/sys/rump/net/lib/libshmif: if_shmem.c

Log Message:
Ignore too short packets.  This condition is true especially for the
first packet on a new bus (len == 0).  Everything else in the stack
besides bpf seemed to be able to deal with one, though.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/rump/net/lib/libshmif/if_shmem.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/libshmif/if_shmem.c
diff -u src/sys/rump/net/lib/libshmif/if_shmem.c:1.54 src/sys/rump/net/lib/libshmif/if_shmem.c:1.55
--- src/sys/rump/net/lib/libshmif/if_shmem.c:1.54	Wed May  1 06:58:36 2013
+++ src/sys/rump/net/lib/libshmif/if_shmem.c	Fri Jun 14 05:56:29 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_shmem.c,v 1.54 2013/05/01 06:58:36 pooka Exp $	*/
+/*	$NetBSD: if_shmem.c,v 1.55 2013/06/14 05:56:29 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.54 2013/05/01 06:58:36 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.55 2013/06/14 05:56:29 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -724,6 +724,12 @@ shmif_rcv(void *arg)
 			    sc, sc->sc_devgen));
 		}
 
+		if (__predict_false(sp.sp_len < ETHER_HDR_LEN)) {
+			DPRINTF(("shmif read packet len %d < ETHER_HDR_LEN\n",
+			    sp.sp_len));
+			continue;
+		}
+
 		m->m_len = m->m_pkthdr.len = sp.sp_len;
 		m->m_pkthdr.rcvif = ifp;
 

Reply via email to