From: Hongzhi Guo Date: Tue, 26 May 2020 10:08:05 +0000 (+0800) Subject: net: fix IPv4 checksum X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=06602c671a5ee23f517456424b216b2427c4334c;p=dpdk.git net: fix IPv4 checksum 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 --- 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; } /**