]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bfdd: remove unnecessary receive timer restart
authorIgor Ryzhov <iryzhov@nfware.com>
Wed, 17 Nov 2021 23:20:43 +0000 (02:20 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Mon, 6 Dec 2021 16:48:25 +0000 (19:48 +0300)
When the detection time expires, we put the session down and restart the
timer. As the comment in the code says, it's needed to zero the remote
discriminator after the second expiration.

But the RFC clearly says that this must be done on the first expiration:

   bfd.RemoteDiscr

      The remote discriminator for this BFD session.  This is the
      discriminator chosen by the remote system, and is totally opaque
      to the local system.  This MUST be initialized to zero.  If a
      period of a Detection Time passes without the receipt of a valid,
      authenticated BFD packet from the remote system, this variable
      MUST be set to zero.

And we actually already do it in `ptm_bfd_sess_dn`, so there's no need
to reset the timer and wait for it twice.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
bfdd/bfd.c

index f49748045719705da6b16e0042abf923005ab7b1..184b82320421a0550091cdac7d4719443fc4bf54 100644 (file)
@@ -639,14 +639,6 @@ int bfd_recvtimer_cb(struct thread *t)
        case PTM_BFD_INIT:
        case PTM_BFD_UP:
                ptm_bfd_sess_dn(bs, BD_CONTROL_EXPIRED);
-               bfd_recvtimer_update(bs);
-               break;
-
-       default:
-               /* Second detect time expiration, zero remote discr (section
-                * 6.5.1)
-                */
-               bs->discrs.remote_discr = 0;
                break;
        }