Skip to content

Commit

Permalink
Merge pull request troglobit#233 from stormshield-sylvainm/work/fix_r…
Browse files Browse the repository at this point in the history
…p_election

fix: on rp election, some variables are not reset

Signed-off-by: Joachim Wiberg <[email protected]>
  • Loading branch information
troglobit authored Aug 11, 2022
2 parents 83423b3 + a6121b0 commit 17ae62f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/rp.c
Original file line number Diff line number Diff line change
Expand Up @@ -835,9 +835,13 @@ rp_grp_entry_t *rp_grp_match(uint32_t group)
if (curr_group_mask > mask_ptr->group_mask)
continue;

/* reset best priority while mask get longer */
/* reset best priority/address/hash value while mask get longer */
if (curr_group_mask < mask_ptr->group_mask)
{
best_priority = ~0;
best_address_h = 0;
best_hash_value = 0;
}

curr_hash_mask_h = ntohl(mask_ptr->hash_mask);
for (entry_ptr = mask_ptr->grp_rp_next; entry_ptr; entry_ptr = entry_ptr->grp_rp_next) {
Expand Down

0 comments on commit 17ae62f

Please sign in to comment.