From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 86A1146BAE for ; Fri, 18 Jul 2025 21:36:12 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7D69340E78; Fri, 18 Jul 2025 21:36:12 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 8504C40611 for ; Fri, 18 Jul 2025 21:36:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752867370; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8q8HEOaCIjwdCnjUizcyTZJ52IULv1x23AWeVYIn/GA=; b=iJsjAau4KMIFTCZ1wBrw7diyjMnnoYb+1nEnM5GuaudgFucGf1VKV0U/03QFeMpVlJFy7T eSrMr5ISeX4gZBYTAZ00t4Z5wmJzwJtRZ+5iO2n/GrphlPb7pNALx5B3oMqbf7QkSXquiW xeVzwggqL4Qriwg9RobPYqAsSkaxctE= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-113-g9m0nWVENcy5512R-5LGjg-1; Fri, 18 Jul 2025 15:36:08 -0400 X-MC-Unique: g9m0nWVENcy5512R-5LGjg-1 X-Mimecast-MFC-AGG-ID: g9m0nWVENcy5512R-5LGjg_1752867367 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BFE9919560AD; Fri, 18 Jul 2025 19:36:07 +0000 (UTC) Received: from rh.redhat.com (unknown [10.44.32.40]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3E20E18004AD; Fri, 18 Jul 2025 19:36:05 +0000 (UTC) From: Kevin Traynor To: Robin Jarry Cc: Junxiao Shi , dpdk stable Subject: patch 'net: fix IPv6 check for IPv4 compat' has been queued to stable release 24.11.3 Date: Fri, 18 Jul 2025 20:30:26 +0100 Message-ID: <20250718193247.1008129-92-ktraynor@redhat.com> In-Reply-To: <20250718193247.1008129-1-ktraynor@redhat.com> References: <20250718193247.1008129-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: lCOJgJ0oppJW_IiqZekLLJ4wIi2B84a5gO2ESQD1rNo_1752867367 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 24.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/23/25. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/c672cdfb7d9ad98135cd99dc4da23fd651adde76 Thanks. Kevin --- >From c672cdfb7d9ad98135cd99dc4da23fd651adde76 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Mon, 24 Feb 2025 15:47:26 +0100 Subject: [PATCH] net: fix IPv6 check for IPv4 compat [ upstream commit bd221bea7080a0c7d18daef4d47924bb59e71664 ] The RFC states that the first 96 bits should be compared, not the first 32 bits. Add unit tests to ensure this works. Bugzilla ID: 1664 Fixes: 3d6d85f58c1c ("net: add utilities for well known IPv6 address types") Reported-by: Junxiao Shi Signed-off-by: Robin Jarry --- .mailmap | 2 +- app/test/test_net_ip6.c | 26 ++++++++++++++++++++++++++ lib/net/rte_ip6.h | 4 ++-- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/.mailmap b/.mailmap index 2acdcfd272..bd43f25315 100644 --- a/.mailmap +++ b/.mailmap @@ -764,5 +764,5 @@ Junlong Wang Jun Qiu Jun W Zhou -Junxiao Shi +Junxiao Shi Jun Wang Jun Yang diff --git a/app/test/test_net_ip6.c b/app/test/test_net_ip6.c index 9cc10b1f71..cfc5509403 100644 --- a/app/test/test_net_ip6.c +++ b/app/test/test_net_ip6.c @@ -100,4 +100,6 @@ test_ipv6_addr_kind(void) TEST_ASSERT(!rte_ipv6_addr_is_loopback(&zero_addr), ""); TEST_ASSERT(!rte_ipv6_addr_is_mcast(&zero_addr), ""); + TEST_ASSERT(rte_ipv6_addr_is_v4compat(&zero_addr), ""); + TEST_ASSERT(!rte_ipv6_addr_is_v4mapped(&zero_addr), ""); const struct rte_ipv6_addr ucast = @@ -107,4 +109,6 @@ test_ipv6_addr_kind(void) TEST_ASSERT(!rte_ipv6_addr_is_loopback(&ucast), ""); TEST_ASSERT(!rte_ipv6_addr_is_mcast(&ucast), ""); + TEST_ASSERT(!rte_ipv6_addr_is_v4compat(&ucast), ""); + TEST_ASSERT(!rte_ipv6_addr_is_v4mapped(&ucast), ""); const struct rte_ipv6_addr mcast = RTE_IPV6(0xff01, 0, 0, 0, 0, 0, 0, 1); @@ -113,4 +117,6 @@ test_ipv6_addr_kind(void) TEST_ASSERT(!rte_ipv6_addr_is_loopback(&mcast), ""); TEST_ASSERT(rte_ipv6_addr_is_mcast(&mcast), ""); + TEST_ASSERT(!rte_ipv6_addr_is_v4compat(&mcast), ""); + TEST_ASSERT(!rte_ipv6_addr_is_v4mapped(&mcast), ""); const struct rte_ipv6_addr lo = RTE_IPV6_ADDR_LOOPBACK; @@ -119,4 +125,6 @@ test_ipv6_addr_kind(void) TEST_ASSERT(rte_ipv6_addr_is_loopback(&lo), ""); TEST_ASSERT(!rte_ipv6_addr_is_mcast(&lo), ""); + TEST_ASSERT(!rte_ipv6_addr_is_v4compat(&lo), ""); + TEST_ASSERT(!rte_ipv6_addr_is_v4mapped(&lo), ""); const struct rte_ipv6_addr local = @@ -126,4 +134,22 @@ test_ipv6_addr_kind(void) TEST_ASSERT(!rte_ipv6_addr_is_loopback(&local), ""); TEST_ASSERT(!rte_ipv6_addr_is_mcast(&local), ""); + TEST_ASSERT(!rte_ipv6_addr_is_v4compat(&local), ""); + TEST_ASSERT(!rte_ipv6_addr_is_v4mapped(&local), ""); + + const struct rte_ipv6_addr v4compat = RTE_IPV6(0, 0, 0, 0, 0, 0, 0xc0a8, 0x0001); + TEST_ASSERT(!rte_ipv6_addr_is_unspec(&v4compat), ""); + TEST_ASSERT(!rte_ipv6_addr_is_linklocal(&v4compat), ""); + TEST_ASSERT(!rte_ipv6_addr_is_loopback(&v4compat), ""); + TEST_ASSERT(!rte_ipv6_addr_is_mcast(&v4compat), ""); + TEST_ASSERT(rte_ipv6_addr_is_v4compat(&v4compat), ""); + TEST_ASSERT(!rte_ipv6_addr_is_v4mapped(&v4compat), ""); + + const struct rte_ipv6_addr v4mapped = RTE_IPV6(0, 0, 0, 0, 0, 0xffff, 0xc0a8, 0x0001); + TEST_ASSERT(!rte_ipv6_addr_is_unspec(&v4mapped), ""); + TEST_ASSERT(!rte_ipv6_addr_is_linklocal(&v4mapped), ""); + TEST_ASSERT(!rte_ipv6_addr_is_loopback(&v4mapped), ""); + TEST_ASSERT(!rte_ipv6_addr_is_mcast(&v4mapped), ""); + TEST_ASSERT(!rte_ipv6_addr_is_v4compat(&v4mapped), ""); + TEST_ASSERT(rte_ipv6_addr_is_v4mapped(&v4mapped), ""); return TEST_SUCCESS; diff --git a/lib/net/rte_ip6.h b/lib/net/rte_ip6.h index 992ab5ee1f..8763ccbb5e 100644 --- a/lib/net/rte_ip6.h +++ b/lib/net/rte_ip6.h @@ -308,5 +308,5 @@ rte_ipv6_addr_is_v4compat(const struct rte_ipv6_addr *ip) { const struct rte_ipv6_addr unspec = RTE_IPV6_ADDR_UNSPEC; - return rte_ipv6_addr_eq_prefix(ip, &unspec, 32) && !rte_ipv6_addr_is_loopback(ip); + return rte_ipv6_addr_eq_prefix(ip, &unspec, 96) && !rte_ipv6_addr_is_loopback(ip); } @@ -326,5 +326,5 @@ rte_ipv6_addr_is_v4mapped(const struct rte_ipv6_addr *ip) { const struct rte_ipv6_addr prefix = RTE_IPV6_ADDR_PREFIX_V4MAPPED; - return rte_ipv6_addr_eq_prefix(ip, &prefix, 32); + return rte_ipv6_addr_eq_prefix(ip, &prefix, 96); } -- 2.50.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-07-18 20:29:14.200556362 +0100 +++ 0092-net-fix-IPv6-check-for-IPv4-compat.patch 2025-07-18 20:29:10.998907539 +0100 @@ -1 +1 @@ -From bd221bea7080a0c7d18daef4d47924bb59e71664 Mon Sep 17 00:00:00 2001 +From c672cdfb7d9ad98135cd99dc4da23fd651adde76 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit bd221bea7080a0c7d18daef4d47924bb59e71664 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -24 +25 @@ -index 9135f06efc..595841dba4 100644 +index 2acdcfd272..bd43f25315 100644 @@ -27 +28 @@ -@@ -771,5 +771,5 @@ Junlong Wang +@@ -764,5 +764,5 @@ Junlong Wang @@ -90 +91 @@ -index 92558a124a..98bcac3f4d 100644 +index 992ab5ee1f..8763ccbb5e 100644