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.
This commit is contained in:
Frdric Lcaille 2019-11-20 11:17:30 +01:00 committed by Willy Tarreau
parent 677e2f2c35
commit 3585cab221
1 changed files with 2 additions and 0 deletions

View 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);
}