]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: peers: "peer alive" flag not reset when deconnecting.
authorFrédéric Lécaille <flecaille@haproxy.com>
Wed, 20 Nov 2019 10:17:30 +0000 (11:17 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 20 Nov 2019 12:38:13 +0000 (13:38 +0100)
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

index 86ab96ede444b2e81a42ab0dc53d3f8079060616..e2581a73b9510106bb3079d5691f0d4368599abf 100644 (file)
@@ -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);
 }