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 make the packet length check less strict, a...



details:   https://anonhg.NetBSD.org/src/rev/fb632e0b151b
branches:  trunk
changeset: 970150:fb632e0b151b
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sat Mar 14 11:52:12 2020 +0000

description:
make the packet length check less strict, allow the physical packet longer
than IP payload

this fixes problem where checksum was not recomputed for short
packets coming from Windows DOMU on same physical host, seems Windows
does some padding; reported by sborrill@

XXX pullup-9

diffstat:

 sys/arch/xen/xen/xennet_checksum.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 01b9b012249b -r fb632e0b151b sys/arch/xen/xen/xennet_checksum.c
--- a/sys/arch/xen/xen/xennet_checksum.c        Sat Mar 14 09:01:11 2020 +0000
+++ b/sys/arch/xen/xen/xennet_checksum.c        Sat Mar 14 11:52:12 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xennet_checksum.c,v 1.3 2007/11/22 16:17:10 bouyer Exp $       */
+/*     $NetBSD: xennet_checksum.c,v 1.4 2020/03/14 11:52:12 jdolecek Exp $     */
 
 /*-
  * Copyright (c)2006 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xennet_checksum.c,v 1.3 2007/11/22 16:17:10 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xennet_checksum.c,v 1.4 2020/03/14 11:52:12 jdolecek Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -124,7 +124,7 @@
        nxt = iph->ip_p;
        iphlen = iph->ip_hl * 4;
        iplen = ntohs(iph->ip_len);
-       if (ehlen + iplen != m->m_pkthdr.len) {
+       if (ehlen + iplen > m->m_pkthdr.len) {
                return EINVAL;
        }
        if (nxt == IPPROTO_UDP) {



Home | Main Index | Thread Index | Old Index