diff --git a/CHANGELOG.md b/CHANGELOG.md index 099d8149203..b5fac034881 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ ### Bugfix * Prevent sending broadcast frames on unicast channel * Delay sending of the first DIO message until parent selection is made and DAO target is published. Fix is made to avoid sending of DIO messages to the unstable network. +* Accept only next possible BSI for detect BR reboot. This fix a bug when PAN timeout happen and node join correctly to new but hear old BSI after that. ## Release v12.6.2 (09-11-2020) diff --git a/source/6LoWPAN/ws/ws_bootstrap.c b/source/6LoWPAN/ws/ws_bootstrap.c index dd0f653f22d..71c623b0d1d 100644 --- a/source/6LoWPAN/ws/ws_bootstrap.c +++ b/source/6LoWPAN/ws/ws_bootstrap.c @@ -1624,10 +1624,15 @@ static void ws_bootstrap_pan_config_analyse(struct protocol_interface_info_entry //When Config is learned and USE Parent BS is enabled compare is this new BSI if (cur->ws_info->configuration_learned && cur->ws_info->pan_information.use_parent_bs && ws_bs_ie.broadcast_schedule_identifier != cur->ws_info->hopping_schdule.fhss_bsi) { - tr_debug("NEW Brodcast Schedule %u...BR rebooted", ws_bs_ie.broadcast_schedule_identifier); - cur->ws_info->ws_bsi_block.block_time = cur->ws_info->cfg->timing.pan_timeout; - cur->ws_info->ws_bsi_block.old_bsi = cur->ws_info->hopping_schdule.fhss_bsi; - ws_bootstrap_event_discovery_start(cur); + //Accept only next possible BSI number + if ((cur->ws_info->hopping_schdule.fhss_bsi + 1) != ws_bs_ie.broadcast_schedule_identifier) { + tr_debug("Do not accept a unknown BSI: %u", ws_bs_ie.broadcast_schedule_identifier); + } else { + tr_debug("NEW Brodcast Schedule %u...BR rebooted", ws_bs_ie.broadcast_schedule_identifier); + cur->ws_info->ws_bsi_block.block_time = cur->ws_info->cfg->timing.pan_timeout; + cur->ws_info->ws_bsi_block.old_bsi = cur->ws_info->hopping_schdule.fhss_bsi; + ws_bootstrap_event_discovery_start(cur); + } return; } }