From 06602c671a5ee23f517456424b216b2427c4334c Mon Sep 17 00:00:00 2001 From: Hongzhi Guo Date: Tue, 26 May 2020 18:08:05 +0800 Subject: [PATCH] net: fix IPv4 checksum MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 0xffff is invalid for IPv4 checksum (RFC1624) Fixes: 6006818cfb26 ("net: new checksum functions") Cc: stable@dpdk.org Signed-off-by: Hongzhi Guo Reviewed-by: Morten Brørup Acked-by: Olivier Matz --- lib/librte_net/rte_ip.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h index 4c4437a547..292f63fd74 100644 --- a/lib/librte_net/rte_ip.h +++ b/lib/librte_net/rte_ip.h @@ -267,7 +267,7 @@ rte_ipv4_cksum(const struct rte_ipv4_hdr *ipv4_hdr) { uint16_t cksum; cksum = rte_raw_cksum(ipv4_hdr, sizeof(struct rte_ipv4_hdr)); - return (cksum == 0xffff) ? cksum : (uint16_t)~cksum; + return (uint16_t)~cksum; } /** -- 2.20.1