From 1e9bae0331bfe8a2a4a8e822a4ef0eb33a71c1e3 Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Tue, 9 Mar 2021 23:08:41 +0300 Subject: [PATCH] bfdd: fix detect timeout RFC 5880 Section 6.8.4: In Asynchronous mode, the Detection Time calculated in the local system is equal to the value of Detect Mult received from the remote system, multiplied by the agreed transmit interval of the remote system (the greater of bfd.RequiredMinRxInterval and the last received Desired Min TX Interval). Signed-off-by: Igor Ryzhov --- bfdd/bfd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bfdd/bfd.c b/bfdd/bfd.c index 3e45bf0e04..499e54603f 100644 --- a/bfdd/bfd.c +++ b/bfdd/bfd.c @@ -1252,12 +1252,12 @@ void bs_final_handler(struct bfd_session *bs) * TODO: support sending/counting more packets inside detection * timeout. */ - if (bs->remote_timers.required_min_rx > bs->timers.desired_min_tx) + if (bs->timers.required_min_rx > bs->remote_timers.desired_min_tx) bs->detect_TO = bs->remote_detect_mult - * bs->remote_timers.required_min_rx; + * bs->timers.required_min_rx; else bs->detect_TO = bs->remote_detect_mult - * bs->timers.desired_min_tx; + * bs->remote_timers.desired_min_tx; /* Apply new receive timer immediately. */ bfd_recvtimer_update(bs);