Stop beaconing if bcning null or absent#216
Open
emanuele-dedonatis wants to merge 1 commit intolorabasics:masterfrom
Open
Stop beaconing if bcning null or absent#216emanuele-dedonatis wants to merge 1 commit intolorabasics:masterfrom
emanuele-dedonatis wants to merge 1 commit intolorabasics:masterfrom
Conversation
Signed-off-by: Emanuele De Donatis <ede@loriot.io>
9953a44 to
d409f2a
Compare
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.
Fix: Beaconing not stopped on reconnection when
bcningfield is absent or nullProblem
Once beaconing was started via
router_config, it could not be stopped on subsequent reconnections. Two cases were broken:"bcning": null— explicitly sending null had no effect; the gateway kept beaconing.bcningfield absent — omitting the field on reconnection lefts2ctx->bcnuntouched and the beacon timer kept running.This was a problem for network servers that send
router_configon every reconnection and rely on the absence ofbcningto mean "no beaconing required".Root Cause
In
handle_router_config()(s2e.c):J_bcning: nullcase justbreaked without clearing any state.bcn.ctrl&0xF0 != 0). There was noelsebranch to stop beaconing when the new config carried no beacon frequencies.Since
bcnis a local variable initialized to zero, a missing or emptybcningfield would always result inbcn.ctrl == 0, silently skipping theifblock and leavings2ctx->bcnand the beacon timer from the previous session intact.Fix
1. Handle
"bcning": nullexplicitly:2. Stop beaconing when
bcningis absent or carries no frequencies:Behaviour After Fix
router_configsent"bcning": { "freqs": [...] }"bcning": nullbcningfield absent"bcning": { "freqs": [] }Files Changed
src/s2e.c