Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/xen/xen Check that m_copyback() didn't fail. Pointe...



details:   https://anonhg.NetBSD.org/src/rev/db1fb53c3316
branches:  trunk
changeset: 584289:db1fb53c3316
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Mon Sep 12 16:30:46 2005 +0000

description:
Check that m_copyback() didn't fail. Pointed out by YAMAMOTO Takashi.

diffstat:

 sys/arch/xen/xen/if_xennet.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r a2779fc7273d -r db1fb53c3316 sys/arch/xen/xen/if_xennet.c
--- a/sys/arch/xen/xen/if_xennet.c      Mon Sep 12 16:24:41 2005 +0000
+++ b/sys/arch/xen/xen/if_xennet.c      Mon Sep 12 16:30:46 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_xennet.c,v 1.35 2005/09/12 12:41:06 yamt Exp $      */
+/*     $NetBSD: if_xennet.c,v 1.36 2005/09/12 16:30:46 bouyer Exp $    */
 
 /*
  *
@@ -33,7 +33,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_xennet.c,v 1.35 2005/09/12 12:41:06 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xennet.c,v 1.36 2005/09/12 16:30:46 bouyer Exp $");
 
 #include "opt_inet.h"
 #include "opt_nfs_boot.h"
@@ -732,6 +732,11 @@
                            (caddr_t)(sc->sc_rx_bufa[rx->id].xb_rx.xbrx_va +
                            (rx->addr & PAGE_MASK)));
                        xennet_rx_push_buffer(sc, rx->id);
+                       if (m->m_pkthdr.len < rx->status) {
+                               ifp->if_ierrors++;
+                               m_freem(m);
+                               break;
+                       }
                }
 
 #ifdef XENNET_DEBUG_DUMP



Home | Main Index | Thread Index | Old Index