🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #15028

[PATCH net-next v3 2/5] seg6: add RFC8986 flavor support for End.X

#15028
From: Hangbin Liu
Date: Thu, 12 Nov 2026 09:27
67 lines
10634 bytes
From: Hangbin Liu <liuhangbin@kylinos.cn>

The End.X behavior only advertises NEXT-C-SID and falls back to plain
input_action_end_x_core() for anything else, so "End.X flavors psp" is
rejected at present. RFC 8986 defines PSP for End.X as well, and
end_flv8986_core() already implements the flavor dispatch used by End.

Add SEG6_LOCAL_FLV8986_SUPP_OPS to SEG6_LOCAL_END_X_FLV_SUPP_OPS and
process flavors in input_action_end_x() the same way input_action_end()
does. With no flavor configured the behavior is unchanged.

Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn>
---
 net/ipv6/seg6_local.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c
index 65d552f87fa3..c827a745fe17 100644
--- a/net/ipv6/seg6_local.c
+++ b/net/ipv6/seg6_local.c
@@ -121,7 +121,8 @@ struct bpf_lwt_prog {
 
 #define SEG6_LOCAL_END_FLV_SUPP_OPS	(SEG6_F_LOCAL_FLV_NEXT_CSID | \
 					 SEG6_LOCAL_FLV8986_SUPP_OPS)
-#define SEG6_LOCAL_END_X_FLV_SUPP_OPS	SEG6_F_LOCAL_FLV_NEXT_CSID
+#define SEG6_LOCAL_END_X_FLV_SUPP_OPS	(SEG6_F_LOCAL_FLV_NEXT_CSID | \
+					 SEG6_LOCAL_FLV8986_SUPP_OPS)
 
 struct seg6_flavors_info {
 	/* Flavor operations */
@@ -884,7 +885,7 @@ static struct ipv6_sr_hdr *seg6_flv8986_get_srh(struct sk_buff *skb)
 }
 
 /* process the packet on the basis of the RFC8986 flavors set for the given
- * SRv6 End behavior instance.
+ * SRv6 End, End.X behavior instance.
  *
  * Returns with skb freed on failure. On success, the caller must complete
  * final processing and forward the packet.
@@ -986,12 +987,20 @@ static int input_action_end_x(struct sk_buff *skb, struct seg6_local_lwt *slwt)
 {
 	const struct seg6_flavors_info *finfo = &slwt->flv_info;
 	__u32 fops = finfo->flv_ops;
+	int ret;
+
+	if (!fops)
+		return input_action_end_x_core(skb, slwt);
 
-	/* check for the presence of NEXT-C-SID since it applies first */
-	if (seg6_next_csid_enabled(fops))
+	/* NEXT-C-SID is evaluated first, when configured */
+	if (seg6_use_next_csid(skb, finfo))
 		return end_x_next_csid_core(skb, slwt);
 
-	return input_action_end_x_core(skb, slwt);
+	ret = end_flv8986_core(skb, slwt);
+	if (ret)
+		return ret;
+
+	return input_action_end_x_finish(skb, slwt);
 }
 
 static int input_action_end_t(struct sk_buff *skb, struct seg6_local_lwt *slwt)

-- 
2.56.0
Technical Details
Message-ID: <20261112-srv6_flavors_endx-v3-2-c9177bbbd965@kylinos.cn>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-361645-linux-kernel-netdev=dewy.ru
References: <20261112-srv6_flavors_endx-v3-0-c9177bbbd965@kylinos.cn>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-361645-linux-kernel-netdev=dewy.ru
From: hangbin.liu@linux.dev (Hangbin Liu)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v3 2/5] seg6: add RFC8986 flavor support for End.X
Date: Thu, 12 Nov 2026 17:27:57 +0800
Organization: Usenet Network
Message-ID: <20261112-srv6_flavors_endx-v3-2-c9177bbbd965@kylinos.cn>
References: <20261112-srv6_flavors_endx-v3-0-c9177bbbd965@kylinos.cn>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="1057703"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:q3G5+HQ91hgNSwPE8nbE5t5ug3Y= sha256:O5IKwJCUG0ZYigChfQGzMGg5Y9/dEJnJWsWtG9lnKDE=
	sha1:x8bYlsQSJ/IoJA1sd6OHozdEuhc= sha256:4aOBWCBDvv0aU/aHEhEsnzqj99OSu2I/m4NlHv7eevU=
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 B5A97114198; Thu, 12 Nov 2026 13:13:36 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 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.249,
	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 tSEEbGINxl5d;
	Thu, 12 Nov 2026 13:13:33 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-361645-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 24B341141A8; Thu, 12 Nov 2026 13:13:23 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 8D0561A7E3C; Thu, 12 Nov 2026 09:29:17 +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=1794475732;
	b=JWfDX2KjVOH0w6HuAlnPv0yBXNOwPBbxRsYEBf/6saVR3HNdnaWiSgQOYmU3/z6YUUUH
	 WQCu8FvWkpEsw+cTsfPLoNxcHtbHpgZAV7S+tEDMyFD20vzmiMUqv5RB4q7OSsf4OaU1s
	 g4uLGvYX4ueNDEUEUj3EzWW7WvmRgH4J337oGzx6S/bLTwfOQYsx1cJUkrWjIqRLCc5R4
	 mC7L1s4eOtaOmNUUtZbTWiwrJY4ngliXFwpYACiyd81MOYMHxoTEaIAIsW4NH0MvfNAlx
	 tITHSe/jbg77SaL+c4QQXcYWWy+nSeTZNfqIyKkFgfyMdwUNs3naMDkWzhHgFdBZnJg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794475732;
	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=Ke3EWszLvsx+ZZ8LVnU5JSdnOIf2Smc8e3pfyBCTnMQ=;
	b=UV2Ji35tPbHYzisEbSwQ5vyfSe4xOADAbqHIdgvKVlS3GDWIm1wP2zgE4ZrnG58qYLT7
	 ber1D17Jppo4/rA3jUYTQso8fnoxjIAfqp8nn6jRQZXdgKuce0lpfT7yka0XP3wkGKuG3
	 EArbPWZO0DkzYXFBTef0kSBZKfMzlHi9RdruY2bresNJSgJHDzgNvEjHvW+/6GMD5pF7C
	 OblN+QJfepn6Kc7D9i5+f9UdyqlENI2TQBMzSRU4N761loxiBs5RJEHpfxx7aONv9M9kh
	 150R79MPsWr7WKRnAGmU2Tzk4VHv4uxXyqdDrzfR3zNmz2mbBet5bjxCsKJa7YFeukA==
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=ghF5sKNP;
	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 413D3606A8A9;
	Thu, 12 Nov 2026 09:28:52 +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=ghF5sKNP
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.175
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794475731;
	b=YMhbppy3gQtDc11lz3N3qd2JM3YvPSAMUw4bhEuPw+3qPhLbUviWUIF/5P02f2e1lxTs
	 zUqhF0r//NzFAhp4eBQexoewGU64z5nhz1EtUWIsALTEhlcggr5ssPxdepWsKGW7gP5wB
	 UkR9xkEG/AcKSpmrX+lVoB+SKxvil6K3pN5/Y+olSh/465+K8ZLLHSVh55a8TBw1MRT7o
	 JHQSxG3lyosX47fAjlNFUBJaPRs3G0RrW/AjzMXlMgLlWYZJZ4Qcxsc4Yfsyl497noKL/
	 RhC1+oYpglmIPoV6jWxIrGD0Yic9BEBoJ+PWN33xBkJ4hYdKNcq9rofnpfcDMvvOxeQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794475731;
	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=Ke3EWszLvsx+ZZ8LVnU5JSdnOIf2Smc8e3pfyBCTnMQ=;
	b=TUA7oJH+cyMFfOU7lEZCPhPDJMAKNchMSA6wYv0Fqlx/LyxJj8lKTy5LLOrBKFzEzOxb
	 qs8an29g+v9gbLFV6Un6mra2w0NZTGK/ceVw2j8b+4/LWa4uYHjb3dnzQw9XY37NFTpt1
	 ewHfMInVtMD4rvhEJHfHsJZjfPJa3/x2DHJe4kvGlYKvU59V+DC3KXxdImn3jvsiW1hHv
	 Qz8hi6zHJQnjWJCP8LsoAHbdTexn2coqwyNnKPvtvDvBk7cqc7tVgbPBHoddPvh14QwbM
	 cRGQYO3n01Y2hXaISHKNcmXXOJBeY7BFu3hMi/odzYCBXzQFrYPb7utHc5Cn4SC6i9w==
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=ghF5sKNP;
	arc=none smtp.remote-ip=95.215.58.175
X-Received: from mta1.migadu.com (out-175.mta1.migadu.com [95.215.58.175])
	(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 86C56606A32A
	for <netdev@vger.kernel.org>; Thu, 12 Nov 2026 09:28:50 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 86C56606A32A
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=0QrA37QX/tYLBaRrcfAU4GLVYO08vkDONNj7UJuckiU=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1794475728; v=1; x=1795080528;
 b=ghF5sKNPiFT09COycE15fZI1ZSINbdB+XdRPh9ucTQpyQbuJlVgvea+B4hIQ5+/sAetcROHo
 388njMLvW/4Q3Yl6xCwpXxsfOYU1BsE7SVhhs7XUmWY2urggSbjoZcQ4icXD8uOIhlCq164kB7o
 8+qbUbskoT9ugnqPyLZBjaas=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by mta10.migadu.com with ESMTPS id 9cb7f3374bf2ccda;
	Thu, 12 Nov 2026 09:28:48 +0000
X-Mizu-Trace-ID: 9cb7f3374bf2ccda
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: <20261112-srv6_flavors_endx-v3-0-c9177bbbd965@kylinos.cn>
X-Cc: Hangbin Liu <hangbin.liu@linux.dev>, netdev@vger.kernel.org, 
 linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, 
 Hangbin Liu <liuhangbin@kylinos.cn>
X-Mailer: b4 0.16.0