diff options
| author | Dave LeRoy <dleroy@labn.net> | 2024-07-17 10:37:44 -0700 |
|---|---|---|
| committer | Dave LeRoy <dleroy@labn.net> | 2024-07-17 10:37:44 -0700 |
| commit | 55de91d8535d15c6cc08f8a36be5363b021e65ce (patch) | |
| tree | 185a384ac25a1c8370933ba970967425f9e74a2b | |
| parent | 3a567e89d7ead7dd4820399e44771986312cfb42 (diff) | |
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>
| -rw-r--r-- | nhrpd/nhrp_vty.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/nhrpd/nhrp_vty.c b/nhrpd/nhrp_vty.c index b938ae4cf0..22b6bdcec7 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; } |
