diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2023-01-26 14:56:04 +0100 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2023-01-27 12:01:20 +0100 |
commit | ae08de9f427ec6b71299ae2786cff19b98d0468f (patch) | |
tree | eac8b492c20355de2a6e1e787cb00f0abfefb04f /pimd/pim_cmd.c | |
parent | *: no-warn pragmas for non-const format strings (diff) | |
download | frr-ae08de9f427ec6b71299ae2786cff19b98d0468f.tar.xz frr-ae08de9f427ec6b71299ae2786cff19b98d0468f.zip |
*: fix non-const northbound XPath format strings
Passing a pre-formatted buffer in these places needs a `"%s"` in front
so it doesn't get formatted twice.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'pimd/pim_cmd.c')
-rw-r--r-- | pimd/pim_cmd.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index 306891c0e..d73ec2990 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -4777,14 +4777,11 @@ DEFPY(ip_msdp_timers, ip_msdp_timers_cmd, "Connection retry period (in seconds)\n") { const char *vrfname; - char xpath[XPATH_MAXLEN]; vrfname = pim_cli_get_vrf_name(vty); if (vrfname == NULL) return CMD_WARNING_CONFIG_FAILED; - snprintf(xpath, sizeof(xpath), FRR_PIM_MSDP_XPATH, "frr-pim:pimd", - "pim", vrfname, "frr-routing:ipv4"); nb_cli_enqueue_change(vty, "./hold-time", NB_OP_MODIFY, holdtime_str); nb_cli_enqueue_change(vty, "./keep-alive", NB_OP_MODIFY, keepalive_str); if (connretry_str) @@ -4794,8 +4791,8 @@ DEFPY(ip_msdp_timers, ip_msdp_timers_cmd, nb_cli_enqueue_change(vty, "./connection-retry", NB_OP_DESTROY, NULL); - nb_cli_apply_changes(vty, xpath); - + nb_cli_apply_changes(vty, FRR_PIM_MSDP_XPATH, "frr-pim:pimd", "pim", + vrfname, "frr-routing:ipv4"); return CMD_SUCCESS; } @@ -4810,20 +4807,17 @@ DEFPY(no_ip_msdp_timers, no_ip_msdp_timers_cmd, IGNORED_IN_NO_STR) { const char *vrfname; - char xpath[XPATH_MAXLEN]; vrfname = pim_cli_get_vrf_name(vty); if (vrfname == NULL) return CMD_WARNING_CONFIG_FAILED; - snprintf(xpath, sizeof(xpath), FRR_PIM_MSDP_XPATH, "frr-pim:pimd", - "pim", vrfname, "frr-routing:ipv4"); - nb_cli_enqueue_change(vty, "./hold-time", NB_OP_DESTROY, NULL); nb_cli_enqueue_change(vty, "./keep-alive", NB_OP_DESTROY, NULL); nb_cli_enqueue_change(vty, "./connection-retry", NB_OP_DESTROY, NULL); - nb_cli_apply_changes(vty, xpath); + nb_cli_apply_changes(vty, FRR_PIM_MSDP_XPATH, "frr-pim:pimd", "pim", + vrfname, "frr-routing:ipv4"); return CMD_SUCCESS; } |