]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: fix incorrect keepalive timer evaluation
authorQuentin Young <qlyoung@qlyoung.net>
Wed, 21 Feb 2018 17:01:34 +0000 (12:01 -0500)
committerQuentin Young <qlyoung@qlyoung.net>
Wed, 21 Feb 2018 18:40:13 +0000 (13:40 -0500)
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 <qlyoung@qlyoung.net>
bgpd/bgp_keepalives.c

index 5a48c7013e63d55425cc7d9d94e76abc3afc263f..1504893c472a105ac30f003bf352dc73811f1faf 100644 (file)
@@ -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;
 }