[DPDK/core Bug 1590] rte_ipv6_phdr_cksum users wrong proto
bugzilla at dpdk.org
bugzilla at dpdk.org
Sun Dec 1 20:02:55 CET 2024
https://bugs.dpdk.org/show_bug.cgi?id=1590
Bug ID: 1590
Summary: rte_ipv6_phdr_cksum users wrong proto
Product: DPDK
Version: 20.11
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: core
Assignee: dev at dpdk.org
Reporter: maaaah at mail.ru
Target Milestone: ---
It seems rte_ipv6_phdr_cksum implementation uses wrong proto field for
pseudo-header during calculating checksum:
static inline uint16_t
rte_ipv6_phdr_cksum(const struct rte_ipv6_hdr *ipv6_hdr, uint64_t ol_flags)
{
uint32_t sum;
struct {
rte_be32_t len; /* L4 length. */
rte_be32_t proto; /* L4 protocol - top 3 bytes must be zero */
} psd_hdr;
psd_hdr.proto = (uint32_t)(ipv6_hdr->proto << 24);
if (ol_flags & PKT_TX_TCP_SEG) {
psd_hdr.len = 0;
} else {
psd_hdr.len = ipv6_hdr->payload_len;
}
sum = __rte_raw_cksum(ipv6_hdr->src_addr,
sizeof(ipv6_hdr->src_addr) + sizeof(ipv6_hdr->dst_addr),
0);
sum = __rte_raw_cksum(&psd_hdr, sizeof(psd_hdr), sum);
return __rte_raw_cksum_reduce(sum);
}
proto is taken directly from the header while RFC 8200 clearly states:
The Next Header value in the pseudo-header identifies the upper-layer protocol
(e.g., 6 for TCP or 17 for UDP). It will differ from the Next Header value in
the IPv6 header if there are extension headers between the IPv6 header and the
upper-layer header.
see https://www.rfc-editor.org/rfc/rfc8200
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/dev/attachments/20241201/888d3338/attachment.htm>
More information about the dev
mailing list