From 4730aeb5e55476ff4f5295f440ec08988f5db977 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Thu, 9 Nov 2023 14:34:52 +0100 Subject: pathd: fix space before pcep port in running-config The below running-configuration has extra spaces before the pce port configuration: > segment-routing > traffic-engineering > pce test > address ip 192.0.2.2 port 1234 > Fix this by keeping only one space. > address ip 192.0.2.2 port 1234 Fixes: efba0985fcdd ("pathd: Add optional support for PCEP to pathd") Signed-off-by: Philippe Guibert --- pathd/path_pcep_cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pathd') diff --git a/pathd/path_pcep_cli.c b/pathd/path_pcep_cli.c index ab61abc02..298dd74d2 100644 --- a/pathd/path_pcep_cli.c +++ b/pathd/path_pcep_cli.c @@ -1706,7 +1706,7 @@ int pcep_cli_pce_config_write(struct vty *vty) &pce_opts->addr.ipaddr_v4); } if (pce_opts->port != PCEP_DEFAULT_PORT) { - vty_out(vty, " %s %d", PCEP_VTYSH_ARG_PORT, + vty_out(vty, " %s %d", PCEP_VTYSH_ARG_PORT, pce_opts->port); } vty_out(vty, "%s\n", buf); -- cgit v1.2.3 From d6d2527448efbdbb6ee7c8d9ae1ac58ee7e0b912 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Thu, 9 Nov 2023 14:49:18 +0100 Subject: pathd: fix 'no msd' command not possible under pcc node It should be possible to reset the configured msd value, and not mentioning the previous msd value. > ubuntu2204(config-sr-te-pcep-pcc)# no msd > % Command incomplete: no msd > ubuntu2204(config-sr-te-pcep-pcc)# Fix this by defining the msd parameter optional, and separating the 'no msd' command from the 'msd' command. Fixe: efba0985fcdd ("pathd: Add optional support for PCEP to pathd") Signed-off-by: Philippe Guibert --- doc/user/pathd.rst | 3 +++ pathd/path_pcep_cli.c | 17 ++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'pathd') diff --git a/doc/user/pathd.rst b/doc/user/pathd.rst index ec107fbe4..fb238100a 100644 --- a/doc/user/pathd.rst +++ b/doc/user/pathd.rst @@ -475,6 +475,9 @@ Configuration Commands Specify the maximum SID depth in a PCC definition. +.. clicmd:: no msd [(1-32)] + + Default the maximum SID depth to 4. .. clicmd:: peer WORD [precedence (1-255)] diff --git a/pathd/path_pcep_cli.c b/pathd/path_pcep_cli.c index 298dd74d2..f0c145c5d 100644 --- a/pathd/path_pcep_cli.c +++ b/pathd/path_pcep_cli.c @@ -1026,7 +1026,7 @@ static int path_pcep_cli_pcc_pcc_msd(struct vty *vty, const char *msd_str, { if (reset) pcc_msd_configured_g = false; - else { + else if (msd_str) { pcc_msd_configured_g = true; PCEP_VTYSH_INT_ARG_CHECK(msd_str, msd, pcc_msd_g, 0, 33); } @@ -2043,12 +2043,22 @@ DEFPY(pcep_cli_no_pcc, DEFPY(pcep_cli_pcc_pcc_msd, pcep_cli_pcc_pcc_msd_cmd, - "[no] msd (1-32)", + "msd (1-32)", NO_STR "PCC maximum SID depth \n" "PCC maximum SID depth value\n") { - return path_pcep_cli_pcc_pcc_msd(vty, msd_str, msd, no); + return path_pcep_cli_pcc_pcc_msd(vty, msd_str, msd, false); +} + +DEFPY(no_pcep_cli_pcc_pcc_msd, + no_pcep_cli_pcc_pcc_msd_cmd, + "no msd [(1-32)]", + NO_STR + "PCC maximum SID depth \n" + "PCC maximum SID depth value\n") +{ + return path_pcep_cli_pcc_pcc_msd(vty, msd_str, msd, true); } DEFPY(pcep_cli_pcc_pcc_peer, @@ -2153,6 +2163,7 @@ void pcep_cli_init(void) install_element(PCEP_NODE, &pcep_cli_no_pcc_cmd); install_element(PCEP_PCC_NODE, &pcep_cli_pcc_pcc_peer_cmd); install_element(PCEP_PCC_NODE, &pcep_cli_pcc_pcc_msd_cmd); + install_element(PCEP_PCC_NODE, &no_pcep_cli_pcc_pcc_msd_cmd); /* Top commands */ install_element(CONFIG_NODE, &pcep_cli_debug_cmd); -- cgit v1.2.3