From 122bbcc44da26f92131f4d3032df427af6d04ce6 Mon Sep 17 00:00:00 2001 From: Joe Stringer Date: Fri, 6 Dec 2013 12:22:07 -0800 Subject: [PATCH] bfd: Set next_tx correctly when processing packets In the case where we have not yet sent a control packet for a bfd connection, and we receive a control packet from the remote host, bfd->next_tx is updated to an unusual value. This causes the logging to incorrectly report that there has been long delays (in the order of weeks) since the last bfd transmission time. This patch only modifies bfd->next_tx in this case if we are not expecting to immediately send a control packet. This should mean that bfd->next_tx is either 0 (immediate tx) or in the order of time_msec(). Signed-off-by: Joe Stringer Signed-off-by: Ben Pfaff --- lib/bfd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/bfd.c b/lib/bfd.c index 69b4f0e67..a4179f869 100644 --- a/lib/bfd.c +++ b/lib/bfd.c @@ -760,7 +760,9 @@ bfd_process_packet(struct bfd *bfd, const struct flow *flow, rmt_min_rx = MAX(ntohl(msg->min_rx) / 1000, 1); if (bfd->rmt_min_rx != rmt_min_rx) { bfd->rmt_min_rx = rmt_min_rx; - bfd_set_next_tx(bfd); + if (bfd->next_tx) { + bfd_set_next_tx(bfd); + } log_msg(VLL_INFO, msg, "New remote min_rx", bfd); } -- 2.43.0