Skip to content

Commit

Permalink
clusterer: Fix bad shtag packet on BACKUP->ACTIVE transition
Browse files Browse the repository at this point in the history
This fixes an issue where a malformed cluster packet (missing trailer
part) would be broadcast on a BACKUP->ACTIVE transition.  Consequently,
both nodes of an Active/Backup pair would have ACTIVE sharing tags after
trying to switch traffic to the Backup node.
  • Loading branch information
liviuchircu committed Sep 13, 2022
1 parent e7b3277 commit a8f3fe6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/clusterer/sharing_tags.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,11 @@ static int shtag_send_active_info(int c_id, str *tag_name, int node_id)
if (bin_push_str(&packet, tag_name) < 0)
return CLUSTERER_SEND_ERR;

if (msg_add_trailer(&packet, c_id, node_id) < 0) {
LM_ERR("Failed to add trailer to module's message\n");
return CLUSTERER_SEND_ERR;
}

if (clusterer_send_msg(&packet, c_id, node_id, 1) !=
CLUSTERER_SEND_SUCCESS) {
bin_free_packet(&packet);
Expand Down

0 comments on commit a8f3fe6

Please sign in to comment.