From 2ccf91b10848bed00f3424ac276f8549609791d4 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Wed, 21 Feb 2018 12:01:34 -0500 Subject: [PATCH] bgpd: fix incorrect keepalive timer evaluation Incorrect check for sentinel value effectively caused peers to sometimes use the keepalive timer value of other peers, which sometimes led to hold timer expiry. Signed-off-by: Quentin Young --- bgpd/bgp_keepalives.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/bgp_keepalives.c b/bgpd/bgp_keepalives.c index 5a48c7013e..1504893c47 100644 --- a/bgpd/bgp_keepalives.c +++ b/bgpd/bgp_keepalives.c @@ -119,7 +119,7 @@ static void peer_process(struct hash_backet *hb, void *arg) } /* if calculated next update for this peer < current delay, use it */ - if (next_update->tv_sec <= 0 || timercmp(&diff, next_update, <)) + if (next_update->tv_sec < 0 || timercmp(&diff, next_update, <)) *next_update = diff; } -- 2.39.5