summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLou Berger <lberger@labn.net>2024-04-23 17:51:33 +0200
committerLou Berger <lberger@labn.net>2024-04-23 17:51:33 +0200
commitcffec3cbad501e1e2a23372a69b981d77f30773b (patch)
tree9c69eb6e56eaafe080c52b9a0301f4fb64e1748e
parentMerge pull request #15798 from opensourcerouting/fix/show_route_map (diff)
downloadfrr-cffec3cbad501e1e2a23372a69b981d77f30773b.tar.xz
frr-cffec3cbad501e1e2a23372a69b981d77f30773b.zip
nhrp: replace hard coded retry time with value derived from holdtime
Signed-off-by: Lou Berger <lberger@labn.net>
-rw-r--r--nhrpd/nhrp_nhs.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/nhrpd/nhrp_nhs.c b/nhrpd/nhrp_nhs.c
index acd3b7df9..f779f9348 100644
--- a/nhrpd/nhrp_nhs.c
+++ b/nhrpd/nhrp_nhs.c
@@ -169,9 +169,15 @@ static void nhrp_reg_send_req(struct event *t)
struct nhrp_cie_header *cie;
if (!nhrp_peer_check(r->peer, 2)) {
- debugf(NHRP_DEBUG_COMMON, "NHS: Waiting link for %pSU",
- &r->peer->vc->remote.nbma);
- event_add_timer(master, nhrp_reg_send_req, r, 120,
+ int renewtime = if_ad->holdtime / 4;
+ /* RFC 2332 5.2.0.1 says "a retry is sent after an appropriate
+ * interval." Using holdtime/4, to be shorter than
+ * recommended renew time (holdtime/3), see RFC2332 Sec 5.2.3
+ */
+ debugf(NHRP_DEBUG_COMMON,
+ "NHS: Waiting link for %pSU, retrying in %d seconds",
+ &r->peer->vc->remote.nbma, renewtime);
+ event_add_timer(master, nhrp_reg_send_req, r, renewtime,
&r->t_register);
return;
}