summaryrefslogtreecommitdiffstats
path: root/nhrpd
diff options
context:
space:
mode:
authorDave LeRoy <dleroy@labn.net>2024-07-17 19:37:44 +0200
committerDave LeRoy <dleroy@labn.net>2024-07-17 19:37:44 +0200
commit55de91d8535d15c6cc08f8a36be5363b021e65ce (patch)
tree185a384ac25a1c8370933ba970967425f9e74a2b /nhrpd
parentMerge pull request #16411 from anlancs/fix/doc-bsr (diff)
downloadfrr-55de91d8535d15c6cc08f8a36be5363b021e65ce.tar.xz
frr-55de91d8535d15c6cc08f8a36be5363b021e65ce.zip
nhrpd: Fixes auth config change bug
Freeing auth-token does not set nifp->auth_token to NULL. Explicitly set auth_token to NULL when deleting auth config in order for write config logic to succeed. Fix bug #16359 Signed-off-by: Dave LeRoy <dleroy@labn.net>
Diffstat (limited to 'nhrpd')
-rw-r--r--nhrpd/nhrp_vty.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/nhrpd/nhrp_vty.c b/nhrpd/nhrp_vty.c
index b938ae4cf..22b6bdcec 100644
--- a/nhrpd/nhrp_vty.c
+++ b/nhrpd/nhrp_vty.c
@@ -481,8 +481,10 @@ DEFPY(if_nhrp_authentication, if_nhrp_authentication_cmd,
return CMD_WARNING_CONFIG_FAILED;
}
- if (nifp->auth_token)
+ if (nifp->auth_token) {
zbuf_free(nifp->auth_token);
+ nifp->auth_token = NULL;
+ }
nifp->auth_token = zbuf_alloc(pass_len + sizeof(uint32_t));
auth = (struct nhrp_cisco_authentication_extension *)
@@ -505,8 +507,10 @@ DEFPY(if_no_nhrp_authentication, if_no_nhrp_authentication_cmd,
VTY_DECLVAR_CONTEXT(interface, ifp);
struct nhrp_interface *nifp = ifp->info;
- if (nifp->auth_token)
+ if (nifp->auth_token) {
zbuf_free(nifp->auth_token);
+ nifp->auth_token = NULL;
+ }
return CMD_SUCCESS;
}