Skip to content

Commit 1d82fd5

Browse files
author
Juha Heiskanen
committed
Wi-sun BBR route update fix
Before add default route and Prefix based on route check that BBR backbone interface is configured. Change-Id: I79f2394e4ffd66d30e16f62e00b2341259ec4467
1 parent 33c48eb commit 1d82fd5

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

source/6LoWPAN/ws/ws_bbr_api.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,9 @@ static void ws_bbr_rpl_status_check(protocol_interface_info_entry_t *cur)
437437
if (configuration & BBR_GUA_ROUTE) {
438438
rpl_control_update_dodag_route(protocol_6lowpan_rpl_root_dodag, current_global_prefix, 64, 0, 0, true);
439439
}
440-
ipv6_route_add_with_info(current_global_prefix, 64, backbone_interface_id, NULL, ROUTE_THREAD_BBR, NULL, 0, 120, 0);
441-
440+
if (backbone_interface_id >= 0) {
441+
ipv6_route_add_with_info(current_global_prefix, 64, backbone_interface_id, NULL, ROUTE_THREAD_BBR, NULL, 0, 120, 0);
442+
}
442443
ws_bbr_dhcp_server_stop(cur, current_global_prefix);
443444
}
444445
// TODO add global prefix
@@ -447,9 +448,11 @@ static void ws_bbr_rpl_status_check(protocol_interface_info_entry_t *cur)
447448
tr_info("RPL global prefix activate %s", trace_ipv6_prefix(global_prefix, 64));
448449
// Add default route to RPL
449450
// Enable default routing to backbone
450-
if (ipv6_route_add_with_info(global_prefix, 64, backbone_interface_id, NULL, ROUTE_THREAD_BBR, NULL, 0, 0xffffffff, 0) == NULL) {
451-
tr_err("global route add failed");
452-
return;
451+
if (backbone_interface_id >= 0) {
452+
if (ipv6_route_add_with_info(global_prefix, 64, backbone_interface_id, NULL, ROUTE_THREAD_BBR, NULL, 0, 0xffffffff, 0) == NULL) {
453+
tr_err("global route add failed");
454+
return;
455+
}
453456
}
454457
ws_bbr_dhcp_server_start(cur, global_prefix);
455458
rpl_control_update_dodag_prefix(protocol_6lowpan_rpl_root_dodag, global_prefix, 64, 0, 0, 0, false);

0 commit comments

Comments
 (0)