From 8f11ffa5a4582e800aeb8507b44b6b3e1f6218bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Sat, 4 Jan 2020 12:33:05 +0000 Subject: [PATCH] Slow down internal rate on dead paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Gallouët --- mud.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mud.c b/mud.c index 47cc1f5..144ff13 100644 --- a/mud.c +++ b/mud.c @@ -1465,7 +1465,9 @@ mud_update(struct mud *mud) } if (mud->peer.set) { - if (mud_timeout(now, path->msg.time, path->conf.msg_timeout)) { + uint64_t timeout = path->msg.sent >= MUD_MSG_SENT_MAX + ? MUD_ONE_SEC : path->conf.msg_timeout; + if (mud_timeout(now, path->msg.time, timeout)) { path->msg.sent++; path->msg.time = now; mud_send_msg(mud, path, now, 0, 0, 0, path->mtu.probe);