From 3585cab22174baea6367526e79585f6115c8b3d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Wed, 20 Nov 2019 11:17:30 +0100 Subject: [PATCH] BUG/MINOR: peers: "peer alive" flag not reset when deconnecting. The peer flags (->flags member of peer struct) are reset by __peer_session_deinit() function. PEER_F_ALIVE flag which is used by the heartbeat part of the peer protocol to mark a peer as being alive was not reset by this function. This simple patch adds add the statement to this. Note that, at this time, there was no identified issue due to this missing reset. Must be backported to 2.0. --- src/peers.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/peers.c b/src/peers.c index 86ab96ede..e2581a73b 100644 --- a/src/peers.c +++ b/src/peers.c @@ -754,6 +754,8 @@ void __peer_session_deinit(struct peer *peer) /* reset teaching and learning flags to 0 */ peer->flags &= PEER_TEACH_RESET; peer->flags &= PEER_LEARN_RESET; + /* set this peer as dead from heartbeat point of view */ + peer->flags &= ~PEER_F_ALIVE; task_wakeup(peers->sync_task, TASK_WOKEN_MSG); }