Skip to content

zebra: add 'no encapsulation' command under segment-routing/srv6#20716

Merged
cscarpitta merged 2 commits intoFRRouting:masterfrom
hedrok:no-encapsulation
Feb 7, 2026
Merged

zebra: add 'no encapsulation' command under segment-routing/srv6#20716
cscarpitta merged 2 commits intoFRRouting:masterfrom
hedrok:no-encapsulation

Conversation

@hedrok
Copy link
Contributor

@hedrok hedrok commented Feb 6, 2026

Add missing command 'no encapsulation'.

Add small static helper function unset_srv6_encapsulation to be used in 'no srv6', 'no encapsulation' and 'no source-address'.

Add test case for this command.

@greptile-apps
Copy link

greptile-apps bot commented Feb 6, 2026

Greptile Overview

Greptile Summary

Added the missing no encapsulation command to the SRv6 configuration hierarchy, allowing users to reset encapsulation settings from the srv6 node level

The implementation:

  • Created a static helper function unset_srv6_encapsulation() that consolidates the duplicate cleanup logic
  • Refactored three commands (no srv6, no encapsulation, no source-address) to use this shared helper
  • Properly installed the new command at the SRV6_NODE level
  • Added comprehensive test coverage that verifies the command correctly resets the encapsulation source address

The change is straightforward and follows existing patterns in the codebase. The refactoring improves maintainability by eliminating code duplication.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes add a missing CLI command using well-established patterns, refactor duplicate code into a single helper function, and include proper test coverage that validates the functionality
  • No files require special attention

Important Files Changed

Filename Overview
zebra/zebra_srv6_vty.c Adds no encapsulation command and refactors duplicate code into unset_srv6_encapsulation() helper
tests/topotests/srv6_encap_src_addr/test_srv6_encap_src_addr.py Adds test case to verify no encapsulation command properly resets SRv6 encap source address

Sequence Diagram

sequenceDiagram
    participant User
    participant VTY as VTY Command Handler
    participant Helper as unset_srv6_encapsulation()
    participant Zebra as zebra_srv6_encap_src_addr_unset()
    participant Dataplane as dplane_srv6_encap_srcaddr_set()

    Note over User,Dataplane: Three commands now share the same cleanup logic

    User->>VTY: no srv6
    VTY->>Helper: unset_srv6_encapsulation()
    Helper->>Zebra: zebra_srv6_encap_src_addr_unset()
    Helper->>Dataplane: dplane_srv6_encap_srcaddr_set(&in6addr_any, NS_DEFAULT)
    VTY-->>User: CMD_SUCCESS

    User->>VTY: no encapsulation (NEW)
    VTY->>Helper: unset_srv6_encapsulation()
    Helper->>Zebra: zebra_srv6_encap_src_addr_unset()
    Helper->>Dataplane: dplane_srv6_encap_srcaddr_set(&in6addr_any, NS_DEFAULT)
    VTY-->>User: CMD_SUCCESS

    User->>VTY: no source-address
    VTY->>Helper: unset_srv6_encapsulation()
    Helper->>Zebra: zebra_srv6_encap_src_addr_unset()
    Helper->>Dataplane: dplane_srv6_encap_srcaddr_set(&in6addr_any, NS_DEFAULT)
    VTY-->>User: CMD_SUCCESS
Loading

…' is run

Add a test cases to verify the SRv6 encapsulation source address is
reset to its default value after running the 'no encapsulation' command
under segment-routing/srv6.

Signed-off-by: Kyrylo Yatsenko <hedrok@gmail.com>
Add missing command 'no encapsulation'.

Add small static helper function `unset_srv6_encapsulation` to be used
in 'no srv6', 'no encapsulation' and 'no source-address'.

Signed-off-by: Kyrylo Yatsenko <hedrok@gmail.com>
@hedrok hedrok requested a review from cscarpitta February 6, 2026 11:22
@hedrok
Copy link
Contributor Author

hedrok commented Feb 6, 2026

ci:rerun Unrelated failure in test_multicast_pim_uplink_topo1

@hedrok
Copy link
Contributor Author

hedrok commented Feb 6, 2026

ci:rerun This time unrelated test_pim_autorp test_pim_autorp_discovery_static failure...

@cscarpitta cscarpitta merged commit b366c6f into FRRouting:master Feb 7, 2026
19 checks passed
@hedrok hedrok deleted the no-encapsulation branch February 7, 2026 07:12
@c-po
Copy link
Contributor

c-po commented Feb 8, 2026

Can this be backported to stable/10.5, too?

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

Labels

master size/M tests Topotests, make check, etc zebra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments