Skip to content

lib: display End.DX2 route with appropriate oif attribute - #20954

Merged
cscarpitta merged 1 commit into
FRRouting:masterfrom
pguibert6WIND:missing_end_dx2_arg
Feb 28, 2026
Merged

lib: display End.DX2 route with appropriate oif attribute#20954
cscarpitta merged 1 commit into
FRRouting:masterfrom
pguibert6WIND:missing_end_dx2_arg

Conversation

@pguibert6WIND

Copy link
Copy Markdown
Member

Without that change, no extra attribute is associated to that SRv6 instruction.

ip route add 2001:db1::/48 encap seg6local action End.DX2 oif dum1 dev loop1

PE1# show ipv6 route
Codes: K - kernel route, C - connected, L - local, S - static,
R - RIPng, O - OSPFv3, I - IS-IS, B - BGP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
F - PBR, f - OpenFabric, t - Table-Direct,
> - selected route, * - FIB route, q - queued, r - rejected, b - backup
t - trapped, o - offload failure

IPv6 unicast VRF default:
K>* 2001:db1::/48 [0/1024] is directly connected, loop1, seg6local End.DX2 oif dum1, weight 1, 00:00:04

Without that change, no extra attribute is associated to that SRv6
instruction.

> ip route add 2001:db1::/48 encap seg6local action End.DX2 oif dum1 dev loop1
>
> PE1# show ipv6 route
> Codes: K - kernel route, C - connected, L - local, S - static,
>        R - RIPng, O - OSPFv3, I - IS-IS, B - BGP, N - NHRP,
>        T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
>        F - PBR, f - OpenFabric, t - Table-Direct,
>        > - selected route, * - FIB route, q - queued, r - rejected, b - backup
>        t - trapped, o - offload failure
>
> IPv6 unicast VRF default:
> K>* 2001:db1::/48 [0/1024] is directly connected, loop1, seg6local End.DX2 oif dum1, weight 1, 00:00:04

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
@greptile-apps

greptile-apps Bot commented Feb 27, 2026

Copy link
Copy Markdown

Greptile Summary

Adds output interface (oif) display for End.DX2 SRv6 routes, fixing a gap where these routes previously showed no additional attributes. The implementation uses if_lookup_by_index with proper NULL handling.

  • Fixed string output to display output interface for End.DX2 routes
  • Properly handles cases where interface lookup fails with "<unknown>" fallback
  • Uses VRF_DEFAULT consistently with existing code patterns in the file
  • Consider updating the JSON output function for consistency

Confidence Score: 4/5

  • This PR is safe to merge with minimal risk
  • Simple, focused fix that adds missing display functionality. Uses proper NULL checking and is consistent with existing patterns. Minor style improvement suggested for JSON output consistency.
  • No files require special attention

Important Files Changed

Filename Overview
lib/srv6.c Added output interface display for End.DX2 routes in string output; JSON output should also be updated for consistency

Last reviewed commit: aa1b702

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@greptile-apps

greptile-apps Bot commented Feb 27, 2026

Copy link
Copy Markdown
Additional Comments (1)

lib/srv6.c
The JSON output for END_DX2 should be updated to include interface information to match the string output changes (lines 216-218). Currently shows "none": true while the string output now displays the output interface.

case ZEBRA_SEG6_LOCAL_ACTION_END_DX2:
	json_object_string_add(json, "interfaceName",
			       ifindex2ifname(ctx->ifindex, VRF_DEFAULT));
	json_object_int_add(json, "interfaceIndex", ctx->ifindex);
	return;
Prompt To Fix With AI
This is a comment left during a code review.
Path: lib/srv6.c
Line: 128-130

Comment:
The JSON output for `END_DX2` should be updated to include interface information to match the string output changes (lines 216-218). Currently shows `"none": true` while the string output now displays the output interface.

```suggestion
case ZEBRA_SEG6_LOCAL_ACTION_END_DX2:
	json_object_string_add(json, "interfaceName",
			       ifindex2ifname(ctx->ifindex, VRF_DEFAULT));
	json_object_int_add(json, "interfaceIndex", ctx->ifindex);
	return;
```

How can I resolve this? If you propose a fix, please make it concise.

@ton31337

Copy link
Copy Markdown
Member

@Mergifyio backport dev/10.6 stable/10.5 stable/10.4 stable/10.3 stable/10.2

@mergify

mergify Bot commented Feb 27, 2026

Copy link
Copy Markdown

backport dev/10.6 stable/10.5 stable/10.4 stable/10.3 stable/10.2

βœ… Backports have been created

Details

Cherry-pick of aa1b702 has failed:

On branch mergify/bp/stable/10.3/pr-20954
Your branch is up to date with 'origin/stable/10.3'.

You are currently cherry-picking commit aa1b7027e.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   lib/srv6.c

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Cherry-pick of aa1b702 has failed:

On branch mergify/bp/stable/10.2/pr-20954
Your branch is up to date with 'origin/stable/10.2'.

You are currently cherry-picking commit aa1b7027e.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   lib/srv6.c

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@cscarpitta cscarpitta left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants