From: Frédéric Lécaille Date: Wed, 20 Nov 2019 10:17:30 +0000 (+0100) Subject: BUG/MINOR: peers: "peer alive" flag not reset when deconnecting. X-Git-Tag: v2.1.0~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3585cab22174baea6367526e79585f6115c8b3d5;p=thirdparty%2Fhaproxy.git 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 86ab96ede4..e2581a73b9 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); }