Skip to content

Commit 7dbad5e

Browse files
author
Arto Kinnunen
authored
Parent sends full network data in response to data request (ARMmbed#1806)
- Parent sends full network data to children in response to data request if Thread neighbor table is uninitialized. - Fix Cppcheck warning by moving trace
1 parent cbe45b4 commit 7dbad5e

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

source/6LoWPAN/Thread/thread_router_bootstrap.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,10 +1991,22 @@ void thread_router_bootstrap_mle_receive_cb(int8_t interface_id, mle_message_t *
19911991
if (!entry_temp || !mle_tlv_read_tlv(MLE_TYPE_TLV_REQUEST, mle_msg->data_ptr, mle_msg->data_length, &requestTlv)) {
19921992
return;
19931993
}
1994+
1995+
uint8_t mode = mle_mode_write_from_mac_entry(entry_temp);
1996+
/* check if thread neighbor class is not initialized */
1997+
if ((thread_neighbor_entry_linkmargin_get(&cur->thread_info->neighbor_class, entry_temp->index) == 0) &&
1998+
(thread_neighbor_last_communication_time_get(&cur->thread_info->neighbor_class, entry_temp->index) == 0)) {
1999+
/*
2000+
* Thread neighbor class is not yet initialized and we receive data_request from such child.
2001+
* Always send full network data in this case
2002+
*/
2003+
mode |= MLE_THREAD_REQ_FULL_DATA_SET | MLE_THREAD_SECURED_DATA_REQUEST;
2004+
} else {
2005+
mode |= thread_neighbor_class_mode_write_from_entry(&cur->thread_info->neighbor_class, entry_temp->index);
2006+
}
2007+
19942008
thread_neighbor_class_update_link(&cur->thread_info->neighbor_class, entry_temp->index,linkMargin, false);
19952009
thread_neighbor_last_communication_time_update(&cur->thread_info->neighbor_class, entry_temp->index);
1996-
uint8_t mode = mle_mode_write_from_mac_entry(entry_temp);
1997-
mode |= thread_neighbor_class_mode_write_from_entry(&cur->thread_info->neighbor_class, entry_temp->index);
19982010
mle_build_and_send_data_response_msg(cur, mle_msg->packet_src_address, mle_msg->data_ptr, mle_msg->data_length, &requestTlv, mode);
19992011
}
20002012
break;

source/Service_Libs/mdns/ns_fnet_port.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,9 @@ fnet_bool_t fnet_netif_get_ip6_addr (fnet_netif_desc_t netif_desc, fnet_index_t
7272
addr_info->type = FNET_NETIF_IP_ADDR_TYPE_AUTOCONFIGURABLE; /* How the address was acquired.*/
7373
result = FNET_TRUE;
7474
}
75+
FNET_DEBUG("fnet_netif_get_ip6_addr(), if=%d: %s", (int8_t)netif->scope_id, trace_ipv6(addr_info->address.addr));
7576
}
7677

77-
FNET_DEBUG("fnet_netif_get_ip6_addr(), if=%d: %s", (int8_t)netif->scope_id, trace_ipv6(addr_info->address.addr));
78-
7978
return result;
8079
}
8180

0 commit comments

Comments
 (0)