[DPDK/ethdev Bug 1664] rte_ipv6_addr_is_v4mapped wrong logic
bugzilla at dpdk.org
bugzilla at dpdk.org
Tue Feb 18 22:04:30 CET 2025
https://bugs.dpdk.org/show_bug.cgi?id=1664
Bug ID: 1664
Summary: rte_ipv6_addr_is_v4mapped wrong logic
Product: DPDK
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: ethdev
Assignee: dev at dpdk.org
Reporter: sunnylandh at gmail.com
Target Milestone: ---
rte_ipv6_addr_is_v4mapped() is implemented by comparing the first 32 bits of an
IPv6 address with the ::ffff:0.0.0.0/96 prefix.
https://git.dpdk.org/dpdk/tree/lib/net/rte_ip6.h?id=fba9875559906e04eaeb74532f4cfd51194259a2#n313
The following snippet prints "1", but the loopback address is not a v4mapped
address.
#include <stdio.h>
#include <rte_ip6.h>
int main() {
struct rte_ipv6_addr a = RTE_IPV6_ADDR_LOOPBACK;
printf("%d\n", rte_ipv6_addr_is_v4mapped(&a));
}
The function should compare the first 96 bits instead.
rte_ipv6_addr_is_v4compat() has the same mistake.
--
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/20250218/40f0af1f/attachment.htm>
More information about the dev
mailing list