Skip to content

Commit b9c0b7d

Browse files
Mika TervonenMika Tervonen
authored andcommitted
Wi-SUN border router starts faster in static configuration
If backbone is started in static mode we dont wait for the extra 4 minutes if we have been put to dynamic environment When we dont have backbone available at all we will start the Wi-SUN with ULA prefix after 5 minutes
1 parent 2f427e1 commit b9c0b7d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

source/6LoWPAN/ws/ws_bbr_api.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,9 +665,16 @@ static void ws_bbr_rpl_status_check(protocol_interface_info_entry_t *cur)
665665
*/
666666
if ((configuration & BBR_ULA_C) == 0 && memcmp(global_prefix, ADDR_UNSPECIFIED, 8) == 0) {
667667
//Global prefix not available count if backup ULA should be created
668+
uint32_t prefix_wait_time = BBR_BACKUP_ULA_DELAY;
668669
global_prefix_unavailable_timer += BBR_CHECK_INTERVAL;
669-
tr_debug("Check for backup prefix %"PRIu32"", global_prefix_unavailable_timer);
670-
if (global_prefix_unavailable_timer >= BBR_BACKUP_ULA_DELAY) {
670+
671+
if (NULL != ws_bbr_bb_static_prefix_get(NULL)) {
672+
// If we have a static configuration we activate it faster.
673+
prefix_wait_time = 40;
674+
}
675+
676+
tr_debug("Check for backup prefix %"PRIu32" / %"PRIu32"", prefix_wait_time, global_prefix_unavailable_timer);
677+
if (global_prefix_unavailable_timer >= prefix_wait_time) {
671678
if (memcmp(current_global_prefix, ADDR_UNSPECIFIED, 8) == 0) {
672679
tr_info("start using backup prefix %s", trace_ipv6_prefix(local_prefix, 64));
673680
}

0 commit comments

Comments
 (0)