Skip to content

packet/bgp: keep every SRv6 End.X SID TLV of a link - #3997

Open
Vadims06 wants to merge 1 commit into
osrg:masterfrom
Vadims06:bgpls-srv6-lan-end-x-sid
Open

Vadims06 wants to merge 1 commit into
osrg:masterfrom
Vadims06:bgpls-srv6-lan-end-x-sid

Conversation

@Vadims06

@Vadims06 Vadims06 commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Keep every End.X SID TLV (1106). RFC 9514 Section 4.1 allows one TLV per End.X SID on a link. Today Extract() keeps only the last one. The new Srv6EndXSIDs field (gRPC srv6_end_x_sids) keeps all of them in TLV order. srv6_end_x_sid still holds the last one, so existing users see no change.

Tests. Attributes with two TLVs check that the list keeps every entry, plus a round trip through the native model and the gRPC API.

The IS-IS and OSPFv3 LAN End.X SID TLVs (1107/1108) were split out of this PR; they follow in a separate PR once this one is reviewed.

RFC 9514 Section 4.1 says:

   More than one instance of this TLV (one for each SRv6 End.X SID) can
   be included in the BGP-LS Attribute.

A router advertises several End.X SIDs on one adjacency, for example
one per algorithm or a protected and an unprotected SID, but
PathAttributeLs.Extract() keeps only the last TLV in Srv6EndXSID, so
the gRPC API shows one of them.

Add Srv6EndXSIDs, which has every End.X SID TLV in TLV order, as
SrAdjacencySIDs does for Adjacency-SID TLVs. Srv6EndXSID still holds
the last TLV, so existing users see no change. The gRPC API gets the
repeated srv6_end_x_sids field. When a path is built from the native
model, srv6_end_x_sids is used if it is set and srv6_end_x_sid
otherwise.

The entries use a new type, LsAttributeLinkSrv6EndXSID, with one SID
and a pointer to the SID Structure, so a TLV without the SID Structure
sub-TLV gives a nil srv6_sid_structure and one with an all-zero SID
Structure keeps it. LsSrv6EndXSID cannot tell the two apart, and its
behaviour for srv6_end_x_sid is unchanged.

apiutil now checks every End.X SID field against its wire width, so a
value that does not fit, such as flags 256, fails AddPath instead of
being truncated. This applies to srv6_end_x_sid as well.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
@Vadims06
Vadims06 force-pushed the bgpls-srv6-lan-end-x-sid branch from b8054bb to 09fed66 Compare December 5, 2026 19:26
@Vadims06 Vadims06 changed the title packet/bgp: every SRv6 End.X SID, and the SRv6 LAN End.X SID TLVs packet/bgp: keep every SRv6 End.X SID TLV of a link Dec 5, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant