From c7f0ba033b1d222821a49f7e4e8c8f4e6291ad73 Mon Sep 17 00:00:00 2001 From: christos Date: Mon, 9 May 2016 15:11:35 +0000 Subject: [PATCH] Account for the CRC len (Jean-Jacques.Puig) --- sys/arch/xen/xen/xennetback_xenbus.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/arch/xen/xen/xennetback_xenbus.c b/sys/arch/xen/xen/xennetback_xenbus.c index 8ab7ece00c25..847bf64463c5 100644 --- a/sys/arch/xen/xen/xennetback_xenbus.c +++ b/sys/arch/xen/xen/xennetback_xenbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: xennetback_xenbus.c,v 1.55 2016/02/09 08:32:10 ozaki-r Exp $ */ +/* $NetBSD: xennetback_xenbus.c,v 1.56 2016/05/09 15:11:35 christos Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.55 2016/02/09 08:32:10 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.56 2016/05/09 15:11:35 christos Exp $"); #include "opt_xen.h" @@ -720,8 +720,9 @@ xennetback_tx_check_packet(const netif_tx_request_t *txreq, int vlan) if (__predict_false(txreq->offset + txreq->size > PAGE_SIZE)) return "crossing a page boundary"; - const int maxlen = - vlan ? (ETHER_VLAN_ENCAP_LEN + ETHER_MAX_LEN) : ETHER_MAX_LEN; + int maxlen = ETHER_MAX_LEN - ETHER_CRC_LEN; + if (vlan) + maxlen += ETHER_VLAN_ENCAP_LEN; if (__predict_false(txreq->size > maxlen)) return "too big";