On Fri, 17 Nov 2023 13:11:50 +0100 Morten Brørup <m...@smartsharesystems.com> wrote:
> > rte_ipv4_udptcp_cksum_mbuf() and rte_ipv6_udptcp_cksum_mbuf() are > > inline > > functions, unfortunately we can't version them. > > > > But those functions already gets IP header as parameter, can't we use > > IP > > header to get the payload size? If so this can be fixed without > > updating > > API. > > If rte_ipv4_udptcp_cksum_mbuf() - or any other function in the DPDK Network > Headers library - includes Ethernet padding (which may be non-zero) when > calculating the TCP/UDP checksum of an IPv4 packet, it is a bug, and must be > fixed there. > > Our test cases should use random padding to catch bugs like this. > > And I just realized that Ethernet padding may be added to any IP packet, so > don't assume that this bug only applies to small packets. Agree. And test code needs lots more header checks it is way too trusting that mbuf is valid.