[PATCH net-next v3 2/5] seg6: add RFC8986 flavor support for End.X
From: Hangbin Liu
Date: Thu Nov 12 2026 - 04:37:09 EST
From: Hangbin Liu <liuhangbin@xxxxxxxxxx>
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@xxxxxxxxxx>
---
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