summaryrefslogtreecommitdiffstats
path: root/nhrpd/nhrp_interface.c
diff options
context:
space:
mode:
authorGaurav Goyal <gaurav.goyal@4rf.com>2021-03-11 01:49:12 +0100
committerReuben Dowle <reuben.dowle@4rf.com>2021-03-17 04:56:46 +0100
commit083bbfaebfe094d52e5125172aedd12c6ac4a958 (patch)
tree720ca75fdd0d110880d99d75a208fb376543dda4 /nhrpd/nhrp_interface.c
parentnhrpd: Retry IPSec if NHRP is repeatedly failing (diff)
downloadfrr-083bbfaebfe094d52e5125172aedd12c6ac4a958.tar.xz
frr-083bbfaebfe094d52e5125172aedd12c6ac4a958.zip
nhrpd: Close IPSec connection when tunnel protection removed
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
Diffstat (limited to 'nhrpd/nhrp_interface.c')
-rw-r--r--nhrpd/nhrp_interface.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/nhrpd/nhrp_interface.c b/nhrpd/nhrp_interface.c
index f86dbe3d2..a328a91b1 100644
--- a/nhrpd/nhrp_interface.c
+++ b/nhrpd/nhrp_interface.c
@@ -465,11 +465,17 @@ void nhrp_interface_set_protection(struct interface *ifp, const char *profile,
struct nhrp_interface *nifp = ifp->info;
if (nifp->ipsec_profile)
+ {
+ vici_terminate_vc_by_profile_name(nifp->ipsec_profile);
free(nifp->ipsec_profile);
+ }
nifp->ipsec_profile = profile ? strdup(profile) : NULL;
if (nifp->ipsec_fallback_profile)
+ {
+ vici_terminate_vc_by_profile_name(nifp->ipsec_fallback_profile);
free(nifp->ipsec_fallback_profile);
+ }
nifp->ipsec_fallback_profile =
fallback_profile ? strdup(fallback_profile) : NULL;