summaryrefslogtreecommitdiff
path: root/bfdd
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2021-12-07 06:38:15 -0500
committerGitHub <noreply@github.com>2021-12-07 06:38:15 -0500
commit46565af731054804576ea0fd364a32776860ec92 (patch)
tree188b1fe24fee3de161307dc00d5c87c8b8c5cf5d /bfdd
parent10d77aab86d62074b01ba919d054c527d237f491 (diff)
parent074f76812bb1961a5d8a4e7b01d7f70f5da1978b (diff)
Merge pull request #10120 from idryzhov/bfd-detect-to
bfdd: fix detection timeout update
Diffstat (limited to 'bfdd')
-rw-r--r--bfdd/bfd.c21
-rw-r--r--bfdd/bfd_packet.c21
2 files changed, 18 insertions, 24 deletions
diff --git a/bfdd/bfd.c b/bfdd/bfd.c
index f497480457..5ca109eef7 100644
--- a/bfdd/bfd.c
+++ b/bfdd/bfd.c
@@ -1226,27 +1226,6 @@ void bs_final_handler(struct bfd_session *bs)
/* Apply new transmission timer immediately. */
ptm_bfd_start_xmt_timer(bs, false);
- /*
- * Detection timeout calculation:
- * The minimum detection timeout is the remote detection
- * multipler (number of packets to be missed) times the agreed
- * transmission interval.
- *
- * RFC 5880, Section 6.8.4.
- *
- * TODO: support sending/counting more packets inside detection
- * timeout.
- */
- if (bs->timers.required_min_rx > bs->remote_timers.desired_min_tx)
- bs->detect_TO = bs->remote_detect_mult
- * bs->timers.required_min_rx;
- else
- bs->detect_TO = bs->remote_detect_mult
- * bs->remote_timers.desired_min_tx;
-
- /* Apply new receive timer immediately. */
- bfd_recvtimer_update(bs);
-
/* Notify watchers about changed timers. */
control_notify_config(BCM_NOTIFY_CONFIG_UPDATE, bs);
}
diff --git a/bfdd/bfd_packet.c b/bfdd/bfd_packet.c
index 5b1329fa37..652b914118 100644
--- a/bfdd/bfd_packet.c
+++ b/bfdd/bfd_packet.c
@@ -697,11 +697,26 @@ int bfd_recv_cb(struct thread *t)
/* Handle poll finalization. */
bs_final_handler(bfd);
- } else {
- /* Received a packet, lets update the receive timer. */
- bfd_recvtimer_update(bfd);
}
+ /*
+ * Detection timeout calculation:
+ * The minimum detection timeout is the remote detection
+ * multipler (number of packets to be missed) times the agreed
+ * transmission interval.
+ *
+ * RFC 5880, Section 6.8.4.
+ */
+ if (bfd->cur_timers.required_min_rx > bfd->remote_timers.desired_min_tx)
+ bfd->detect_TO = bfd->remote_detect_mult
+ * bfd->cur_timers.required_min_rx;
+ else
+ bfd->detect_TO = bfd->remote_detect_mult
+ * bfd->remote_timers.desired_min_tx;
+
+ /* Apply new receive timer immediately. */
+ bfd_recvtimer_update(bfd);
+
/* Handle echo timers changes. */
bs_echo_timer_handler(bfd);