Merge pull request #16417 from LabNConsulting/dleroy/nhrpd-noauth-fix

nhrpd: Fixes auth config change bug
This commit is contained in:
Jafar Al-Gharaibeh 2024-07-18 12:20:15 -04:00 committed by GitHub
commit 272077d2ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
}