need to retain csum_flags in xennetback_copymbuf() when creating

new mbuf for the COPY transmit path, so that later NETRXF_csum_blank
flag is set correctly when passing request over to DomU

fixes bad checksums in DomU when xvif(4) TX offload is enabled;
problem observed when testing new IPv6 offloading, but it should
affect also existing IPv4 offloading

Note: code in xennet(4) is unaffected, there code consults the original
mbuf, rather than the new_m one
This commit is contained in:
jdolecek 2020-03-21 23:25:53 +00:00
parent e01b61be71
commit 1c3d30038a

View File

@ -1,4 +1,4 @@
/* $NetBSD: xennetback_xenbus.c,v 1.82 2020/03/19 11:19:25 jdolecek Exp $ */
/* $NetBSD: xennetback_xenbus.c,v 1.83 2020/03/21 23:25:53 jdolecek Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.82 2020/03/19 11:19:25 jdolecek Exp $");
__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.83 2020/03/21 23:25:53 jdolecek Exp $");
#include "opt_xen.h"
@ -1224,6 +1224,13 @@ xennetback_copymbuf(struct mbuf *m)
mtod(new_m, void *));
new_m->m_len = new_m->m_pkthdr.len =
m->m_pkthdr.len;
/*
* Need to retain csum flags to know if csum was actually computed.
* This is used to set NETRXF_csum_blank/NETRXF_data_validated.
*/
new_m->m_pkthdr.csum_flags = m->m_pkthdr.csum_flags;
return new_m;
}