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.
diff --git a/src/peers.c b/src/peers.c
index 86ab96e..e2581a7 100644
--- a/src/peers.c
+++ b/src/peers.c
@@ -754,6 +754,8 @@
/* 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);
}