pimd: fix C-RP processing crash during BSR_PENDING state (backport #22467) - #22566
Merged
Conversation
When a candidate BSR is in BSR_PENDING state (waiting to become elected), C-RP advertisements may arrive. The bsr_crp_reselect() function would then call pim_bsm_generate_sched(), which asserts state == BSR_ELECTED. Fix by adding a state check in bsr_crp_reselect() before calling pim_bsm_generate_sched(). Signed-off-by: Enke Chen <enchen@paloaltonetworks.com> (cherry picked from commit 6f410e8)
Add two tests for BSR_PENDING state handling: 1. test_pim_bsr_pending_timer_race: Verify BSR_PENDING timer is not overwritten by BSM reception. The test removes r1 as BSR candidate, lowers then raises r2's priority to force re-entry to BSR_PENDING, then re-adds r1 to trigger BSM during r2's PENDING window. Without the fix in pim_bsm_update() to skip pim_bs_timer_restart() when in BSR_PENDING state, the BSM would overwrite the ~5 second pending timer with the 130-second BS liveness timer. 2. test_pim_crp_during_bsr_pending: Verify C-RP advertisements received during BSR_PENDING state don't crash. Without the state check in bsr_crp_reselect(), pim_bsm_generate_sched() would assert when called before BSR_ELECTED. Signed-off-by: Enke Chen <enchen@paloaltonetworks.com> (cherry picked from commit fab17c0)
|
Target branch is not in the allowed branches list. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
manual backport