]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bfdd: fix detect timeout
authorIgor Ryzhov <iryzhov@nfware.com>
Tue, 9 Mar 2021 20:08:41 +0000 (23:08 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Wed, 24 Mar 2021 15:55:56 +0000 (18:55 +0300)
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 <iryzhov@nfware.com>
bfdd/bfd.c

index 19cdb319909c98f774ae06606ac8c49c419a8737..d0182281337061c05d1d3a3b71b3ede75c0fb5c3 100644 (file)
@@ -1233,12 +1233,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);