Article View: linux.kernel.netdev
Article #8134[PATCH 2/3] ipv6: ioam6: use transformed packet nexthdr for ECMP re-lookup
From: Hangbin Liu
Date: Wed, 28 Oct 2026 05:45
Date: Wed, 28 Oct 2026 05:45
49 lines
10034 bytes
10034 bytes
From: Hangbin Liu <liuhangbin@kylinos.cn>
RFC 9486 (C2) requires that the ECMP hash of a packet carrying IOAM
options is the same as the hash of the identical packet without them.
When the ioam6 output path misses the destination cache, it re-looks
up the route for the transformed packet. Under the default hash
policy 0 that lookup hashed NEXTHDR_HOP rather than the nexthdr the
identical packet without IOAM would carry, so it could pick a
different ECMP sibling.
Use the Hop-by-Hop nexthdr already stored by do_inline()/do_encap()
(eh.nexthdr) for the re-lookup, and precompute the multipath hash
from the packet: ip6_route_output() lookups carry no skb, so without
this ICMPv6 errors would stop hashing their quoted flow and L4 hash
policy packets would lose their ports.
Fixes: 8cb3bf8bff3c ("ipv6: ioam: Add support for the ip6ip6 encapsulation")
Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn>
---
net/ipv6/ioam6_iptunnel.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/ipv6/ioam6_iptunnel.c b/net/ipv6/ioam6_iptunnel.c
index cfb2c41634a0..713e625bfa3a 100644
--- a/net/ipv6/ioam6_iptunnel.c
+++ b/net/ipv6/ioam6_iptunnel.c
@@ -13,6 +13,7 @@
#include <linux/ioam6.h>
#include <linux/ioam6_iptunnel.h>
#include <net/dst.h>
+#include <net/ip6_route.h>
#include <net/sock.h>
#include <net/lwtunnel.h>
#include <net/ioam6.h>
@@ -412,7 +413,8 @@ static int ioam6_output(struct net *net, struct sock *sk, struct sk_buff *skb)
fl6.saddr = hdr->saddr;
fl6.flowlabel = ip6_flowinfo(hdr);
fl6.flowi6_mark = skb->mark;
- fl6.flowi6_proto = hdr->nexthdr;
+ fl6.flowi6_proto = ilwt->tuninfo.eh.nexthdr;
+ fl6.mp_hash = rt6_multipath_hash(net, &fl6, skb, NULL);
dst = ip6_route_output(net, NULL, &fl6);
if (dst->error) {
--
2.56.0
Technical Details
Message-ID:
<20261028-ipv6_ioam_ecmp-v1-2-9b6715b6f4c0@kylinos.cn>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352737-linux-kernel-netdev=dewy.ruReferences:
<20261028-ipv6_ioam_ecmp-v1-0-9b6715b6f4c0@kylinos.cn>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352737-linux-kernel-netdev=dewy.ru From: hangbin.liu@linux.dev (Hangbin Liu) Newsgroups: linux.kernel.netdev Subject: [PATCH 2/3] ipv6: ioam6: use transformed packet nexthdr for ECMP re-lookup Date: Wed, 28 Oct 2026 13:45:30 +0800 Organization: Usenet Network Message-ID: <20261028-ipv6_ioam_ecmp-v1-2-9b6715b6f4c0@kylinos.cn> References: <20261028-ipv6_ioam_ecmp-v1-0-9b6715b6f4c0@kylinos.cn> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="1709206"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:3FvAyxlogCx3dirIfBouDJSf2Q4= sha256:K8zF6BfHrhJwg8uzeijVV+pwAweLS6SrA/iVF/pHkbU= sha1:l7LqFyoxfBdI9AZ0Kjmjsa+lI0Q= sha256:aHIFWfycg+wrGesKiTiTxmqWclnAwU5i4P9Zb79D/5I= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 46A23125C2F; Wed, 28 Oct 2026 08:47:46 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=linux.dev X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 02g02vUGNl3P; Wed, 28 Oct 2026 08:47:44 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-352737-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id C8282125C2D; Wed, 28 Oct 2026 08:47:35 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 3DF542CD05; Wed, 28 Oct 2026 05:46:10 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793166370; b=VHL+Q3cJPhaubb1XL6bvNEnZBv/8P9jzocp7lZS8viI0FqFl6MVxFg8ezUOTTAJRXwTn 8rQROPvo31rFn/Eq/u5nV7AeW4nQSpAYFUFie3k9/7RzTP+1OVzKIWhwz4fLtMP1C654E D8NW/igbne5eyb5dYJtvAlHCJbnZ3JzOj+mKGUCrT9Vsdd4hp03eahIHgYxd4uRBTTndn WN7z6u92gr48v1Nuk7NiPidylltyMpWNtYlDWgcsPeF6XqtjWYN2ZTJSWZSdE268Ghj7c +1dHenvL2B6ioDkiWS+1ogkxrr5GKV4uWEOamdGnC/adnnI2zYeUfDxyVfodGVBp6mg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793166370; h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature: X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:From:Date: Subject:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:References:In-Reply-To:To:Cc: X-Mailer; bh=kjFfc0DyBz/PhoEfh4CFGhSYK0Li8U1aA84+IyfHCTM=; b=aJvft1lIpDDBgRn3iLiZUDarMb4F/RL1JcEFW3FI+wAJB2BdgtQAGdKawum7wbSje2RL wKlKlWFyeedHOig3305j2uWYevfSYaFwfqzzh7fg6bzupy+XFRnQC4/0ai2OIUooNxobF Ix8CXk/P1bQcd53yPHcLZfYFumuke/3P+wScm4Vo3gDN92ORAPVT6R7NK3umEnB+JwDN0 s8vhQhYXDhUEr1ckhDKOfmEzsoAXlKp2cO2GcX43dUNr6zWJQO9f5Mz21438FfJtVAcwg CzBh1dcAeNYggJwTnToAEpIMdFcMTJFlW22UO7k7HtpjZbelqze3bqmdTC2UB3z0oIg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=VOw+vpTk; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E3F44606A31A; Wed, 28 Oct 2026 05:46:09 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=VOw+vpTk X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.73 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793166364; b=1M9j5ybxjfzBOYzNeCjvQcHZYZ1FsU6Y54I6bkARgpdXuCsw2s+S9oky2rwuZfRqedQp HG7HW5GnhFZWrKgbKC1pzqjiOjMUhAimUhqAt/ITqSpLVKXHXx3odYh3EIhLmsXRYcdOD vbJA0aPgbaGcqCnlOcruAfYKTthQKA1LanFwBA0pLgJ4+ma9DVO8br1RDZguij7wT5ugd l61NLZ2NwWkCRhDb0+X04eCCB8zmLWTobrS/FI2cDOjaNqYWkyK8qec9Qv50mci/alzgR NiK6vp8PleXImYCI0Fs0zWL0jJzj6s+7u7qUZMKfZo1rNcY1YGa5mAwGeAfuLFmbw/w== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793166364; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:From:Date:Subject:MIME-Version: Content-Type:Content-Transfer-Encoding:Message-Id:References: In-Reply-To:To:Cc:X-Mailer; bh=kjFfc0DyBz/PhoEfh4CFGhSYK0Li8U1aA84+IyfHCTM=; b=f5QTclvyVnv6xFhVF+V5fqZ3UW705VJOd9NEnhcXQE+Yj69bxhDCyA2V+2egnNk4Hrfq HusIMYTnLgEoIOPwsowQXUlUHoKECtGc3Bj+uIpUWh+Ed3Rp/TxmibGBcjOfNjAQzH7RH P6U67wtHQ9IrO6vP2xeLNx5cDDO2h1V8EH4LPC9Xufg0fvvYkWI3bfObCqmb3hAf6mwCb HsfI/8aAIGclPGMw416bWKb/SP8040RvWSEE7Lb2KFUvw7J9YYSB7QxvJ+2c7jl6pFwSX VgK4movOnaRhdjHPMfWzUJD5Ho2TI6ArjhD7gpVMa4VFHjDsrxdpw87EjMmxaV4B7rA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=VOw+vpTk; arc=none smtp.remote-ip=91.218.175.73 X-Received: from mta0.migadu.com (out-73.mta0.migadu.com [91.218.175.73]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 662B2606A31D for <netdev@vger.kernel.org>; Wed, 28 Oct 2026 05:46:03 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 662B2606A31D X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: netdev@vger.kernel.org X-DKIM-Signature: a=rsa-sha256; bh=Q7cdOCTYN1OsRVYA/tnnim8OAfOBZPX8C+UEQBNvTwM=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1793166361; v=1; x=1793771161; b=VOw+vpTkTqI+uMYqdT+N+xUSyXCGL5KMwWJdAteFa17ZDaueyU34Vvw9pe7Vo6RwUD7apEy2 +L9lTbVsNd/BBrDsSgMI95qCgNMN02kmAzQbT59mcv7O7P1DeRrGBMMV/FiPPnTr2nvUcFcsbwP pCQ92n+6/IrJhnNohtJXAEwo= X-Envelope-To: netdev@vger.kernel.org X-Received: by mta11.migadu.com with ESMTPS id 1372610438f61ffd; Wed, 28 Oct 2026 05:46:01 +0000 X-Mizu-Trace-ID: 1372610438f61ffd X-Migadu-Flow: FLOW_OUT X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <20261028-ipv6_ioam_ecmp-v1-0-9b6715b6f4c0@kylinos.cn> X-Cc: Hangbin Liu <hangbin.liu@linux.dev>, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, Hangbin Liu <liuhangbin@kylinos.cn> X-Mailer: b4 0.16.0