Skip to content

Commit 64c5f23

Browse files
author
Juha Heiskanen
committed
Update Pan information when it heard from Parent.
Change-Id: Id2494c996c304eae1bf1e2d39ea76d823de1befc
1 parent 2b61377 commit 64c5f23

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,7 @@ static void ws_bootstrap_pan_advertisement_analyse(struct protocol_interface_inf
845845

846846
// Save route cost for all neighbours
847847
llc_neighbour_req_t neighbor_info;
848+
neighbor_info.neighbor = NULL;
848849
if (ws_bootstrap_neighbor_info_request(cur, data->SrcAddr, &neighbor_info, false)) {
849850
neighbor_info.ws_neighbor->routing_cost = pan_information.routing_cost;
850851
}
@@ -921,12 +922,16 @@ static void ws_bootstrap_pan_advertisement_analyse(struct protocol_interface_inf
921922
ws_bootstrap_pan_advertisement_analyse_active(cur, &pan_information);
922923

923924
// Learn latest network information
924-
if (cur->bootsrap_mode != ARM_NWK_BOOTSRAP_MODE_6LoWPAN_BORDER_ROUTER) {
925-
cur->ws_info->pan_information.pan_size = pan_information.pan_size;
926-
cur->ws_info->pan_information.routing_cost = pan_information.routing_cost;
927-
cur->ws_info->pan_information.rpl_routing_method = pan_information.rpl_routing_method;
928-
cur->ws_info->pan_information.use_parent_bs = pan_information.use_parent_bs;
929-
cur->ws_info->pan_information.version = pan_information.version;
925+
if (cur->bootsrap_mode != ARM_NWK_BOOTSRAP_MODE_6LoWPAN_BORDER_ROUTER && neighbor_info.neighbor) {
926+
927+
if (neighbor_info.neighbor->link_role == PRIORITY_PARENT_NEIGHBOUR) {
928+
cur->ws_info->pan_information.pan_size = pan_information.pan_size;
929+
cur->ws_info->pan_information.routing_cost = pan_information.routing_cost;
930+
cur->ws_info->pan_information.rpl_routing_method = pan_information.rpl_routing_method;
931+
cur->ws_info->pan_information.use_parent_bs = pan_information.use_parent_bs;
932+
cur->ws_info->pan_information.version = pan_information.version;
933+
}
934+
930935
}
931936
}
932937

0 commit comments

Comments
 (0)