]> git.puffer.fish Git - matthieu/frr.git/commitdiff
staticd: Fix `no srv6` command
authorCarmine Scarpitta <cscarpit@cisco.com>
Tue, 25 Feb 2025 23:24:49 +0000 (00:24 +0100)
committerCarmine Scarpitta <cscarpit@cisco.com>
Sat, 1 Mar 2025 22:24:46 +0000 (23:24 +0100)
A user can configure static SIDs as follows:

[...]
segment-routing
 srv6
  static-sids
   sid fcbb:bbbb:1::/48 locator MAIN behavior uN
   sid fcbb:bbbb:1:fe00::/64 locator MAIN behavior uDT46
[...]

When the user runs vtysh and executes the `no srv6` command, the
expectation is that staticd will deallocate all SIDs.

However, currently FRR does not behaves as expected. After the user
executes `no srv6`, the SIDs are still present.

The problem is that vtysh does not forward the `no srv6` command to
mgmtd/staticd.

The `no srv6` command is defined using the `DEFUN_YANG_NOSH` macro,
which instructs `xref2vtysh.py` to skip the `no srv6` command during
the generation of `vtysh_cmd.c`. As a result, vtysh is unaware that it
should forward the `no srv6` command to mgmtd/staticd.

This commit fixes the issue by replacing `DEFUN_YANG_NOSH` with
`DEFUN_YANG`. This change ensures that `xref2vtysh.py` includes the
`no srv6` command when generating `vtysh_cmd.c` and makes vtysh forward
the `no srv6` command to mgmtd/staticd.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
staticd/static_vty.c

index 92965681e353525ec770490bf8452cf8b0e97691..ffa90d5352d880f2dbcbb9edf2d29247efa55332 100644 (file)
@@ -1175,7 +1175,7 @@ DEFUN_NOSH (static_srv6, static_srv6_cmd,
        return CMD_SUCCESS;
 }
 
-DEFUN_YANG_NOSH (no_static_srv6, no_static_srv6_cmd,
+DEFUN_YANG (no_static_srv6, no_static_srv6_cmd,
       "no srv6",
       NO_STR
       "Segment Routing SRv6\n")