Skip to content

Commit 82bbdcc

Browse files
author
Juhani Puurula
committed
Merge branch 'release_internal' into release_external
* release_internal: (52 commits) address error sent when matching entry found. (#1695) Keep parent mle_entry in child_update_req timeout (#1693) Changed BBR router upgrade status (#1661) Compiler warning clean-up (#1690) Detection of duplicate address entries updated (#1686) pbbr route handling updated (#1681) MLE parent request timeout fixes (#1676) Remove fragment/PMTU handling dropped by RFC 8200 entry keep alive flag set to true if entry already exists. (#1675) Extra Thread-specific address check handling Tighten core "for us" check for unicast addresses address query logic implemented(#1667) Fix for Router advertisement process in REED (#1658) Thread DHCP address allocation fix (#1657) removed the dependence of AE message relay on DUA prefix (#1655) REED parser refactoring for MLE advertisement (#1654) Clear data request flag in child_id_req timeout (#1649) updated mleid rloc sync in leader. (#1645) Added filter callback for MLE messages (#1638) Security bits handled correctly (#1642) ...
2 parents 43c7ec2 + 7c7568d commit 82bbdcc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+848
-509
lines changed

nanostack/net_interface.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,7 @@ extern void net_get_version_information(uint8_t *ptr);
995995
*
996996
* Note! In Thread mode parent buffer size is automatically set during Thread initialization.
997997
*
998+
* \param interface_id Network interface ID.
998999
* \param big_packet_threshold Indicate how long packets are considered big. For Thread, must be 106 bytes.
9991000
* \param small_packets_per_child_count Number of small packets stored for each sleepy children. For Thread, must be at least 1.
10001001
* \param big_packets_total_count Total number of big packets parent can store for all sleepy children. For Thread, must be at least 1.

nanostack/net_test_api.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#define NET_TEST_API_H_
2525

2626
#include "ns_types.h"
27+
#include "Service_Libs/mle_service/mle_service_api.h"
2728

2829
/**
2930
* \brief Makes TCP protocol drop given number of packets from a particular state (TX side).
@@ -56,4 +57,11 @@ int8_t arm_nwk_test_tcp_drop_rx(int state, uint8_t count);
5657
*/
5758
void arm_nwk_test_tcp_drop_reset(void);
5859

60+
/**
61+
* \brief Set callback for MLE message receiving filter.
62+
*
63+
* Testing API for setting MLE receive callback for message filtering purposes.
64+
*/
65+
void arm_nwk_test_mle_receive_filter_set(mle_service_filter_cb *response_filter_cb);
66+
5967
#endif //NET_TEST_API_H_

nanostack/net_thread_test.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,19 @@ int thread_test_increment_key_sequence_counter(int8_t interface_id);
274274
*/
275275
int thread_test_key_sequence_counter_update(int8_t interface_id, uint32_t thrKeySequenceCounter);
276276

277+
/**
278+
* \brief Resets cached values from stack
279+
*
280+
Resets link configuration from cache and from NVM.
281+
*
282+
*
283+
* \param interface_id Network Interface
284+
*
285+
* \return 0, OK
286+
* \return <0 Error
287+
*/
288+
int thread_test_stack_cache_reset(int8_t interface_id);
289+
277290
/**
278291
* \brief Set new Thread key rotation value
279292
*

source/6LoWPAN/Bootstraps/Generic/protocol_6lowpan_bootstrap.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ static int mle_router_accept_request_build(protocol_interface_info_entry_t *cur,
758758

759759
static void protocol_6lowpan_link_reject_handler(protocol_interface_info_entry_t *cur, uint8_t *ll64)
760760
{
761-
mle_neigh_table_entry_t *entry_temp = mle_class_get_entry_by_ll64(cur->id, 0, ll64, false);
761+
mle_neigh_table_entry_t *entry_temp = mle_class_get_entry_by_ll64(cur->id, 0, ll64, false, NULL);
762762
tr_debug("MLE link reject");
763763
if (entry_temp) {
764764
mle_class_remove_entry(cur->id, entry_temp);
@@ -1081,7 +1081,7 @@ void mle_6lowpan_message_handler(int8_t interface_id, mle_message_t *mle_msg, ml
10811081
mle_6lowpan_data->link_req_token_bucket--;
10821082
} else {
10831083
//Update only old information based on link request
1084-
entry_temp = mle_class_get_entry_by_ll64(interface_id, linkMargin, mle_msg->packet_src_address, false);
1084+
entry_temp = mle_class_get_entry_by_ll64(interface_id, linkMargin, mle_msg->packet_src_address, false, NULL);
10851085
if (entry_temp) {
10861086
mle_neigh_time_and_mode_update(entry_temp,mle_msg->data_ptr, mle_msg->data_length);
10871087
mle_neigh_entry_update_by_mle_tlv_list(interface_id, entry_temp, mle_msg->data_ptr, mle_msg->data_length, cur->mac, own_mac16);
@@ -1118,12 +1118,12 @@ void mle_6lowpan_message_handler(int8_t interface_id, mle_message_t *mle_msg, ml
11181118

11191119
tr_debug("Accept & Request");
11201120

1121-
entry_temp = mle_class_get_entry_by_ll64(interface_id, linkMargin, mle_msg->packet_src_address, false);
1121+
entry_temp = mle_class_get_entry_by_ll64(interface_id, linkMargin, mle_msg->packet_src_address, false, NULL);
11221122

11231123
if (!entry_temp) {
11241124
// If there is space for neighbors try to allocate new entry
11251125
if (mle_6lowpan_neighbor_limit_check(interface_id, mle_msg, true)) {
1126-
entry_temp = mle_class_get_entry_by_ll64(interface_id, linkMargin, mle_msg->packet_src_address, true);
1126+
entry_temp = mle_class_get_entry_by_ll64(interface_id, linkMargin, mle_msg->packet_src_address, true, NULL);
11271127
}
11281128
}
11291129

@@ -1185,7 +1185,7 @@ void mle_6lowpan_message_handler(int8_t interface_id, mle_message_t *mle_msg, ml
11851185
mode = *t_ptr;
11861186
}
11871187

1188-
entry_temp = mle_class_get_entry_by_ll64(interface_id, linkMargin, mle_msg->packet_src_address, false);
1188+
entry_temp = mle_class_get_entry_by_ll64(interface_id, linkMargin, mle_msg->packet_src_address, false, NULL);
11891189
if (!entry_temp) {
11901190
if ((mode & MLE_DEV_MASK) == MLE_FFD_DEV) {
11911191
// If there is space for neighbors synchronizes to new router
@@ -2787,7 +2787,7 @@ bool lowpan_neighbour_data_clean(int8_t interface_id, const uint8_t *link_local_
27872787
{
27882788
bool return_value = false;
27892789
#ifndef NO_MLE
2790-
mle_neigh_table_entry_t * neigh_entry = mle_class_get_entry_by_ll64(interface_id, 0, link_local_address, false);
2790+
mle_neigh_table_entry_t * neigh_entry = mle_class_get_entry_by_ll64(interface_id, 0, link_local_address, false, NULL);
27912791
if (neigh_entry) {
27922792
//Remove entry
27932793
if (neigh_entry->priorityFlag) {

source/6LoWPAN/Bootstraps/Generic/protocol_6lowpan_interface.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ static int8_t set_6lowpan_nwk_down(protocol_interface_info_entry_t *cur)
8787
#endif
8888
}
8989
}
90-
uint16_t pan_id = cur->mac_parameters->pan_id;
90+
if (cur->lowpan_info & INTERFACE_NWK_BOOTSRAP_PANA_AUTHENTICATION) {
91+
pana_reset_values(cur->mac_parameters->pan_id);
92+
}
93+
9194
if (cur->interface_mode == INTERFACE_UP) {
9295
if (cur->mac_api) {
9396
mlme_reset_t reset;
@@ -105,9 +108,6 @@ static int8_t set_6lowpan_nwk_down(protocol_interface_info_entry_t *cur)
105108
reassembly_interface_reset(cur->id);
106109

107110
icmp_nd_routers_init();
108-
if (cur->lowpan_info & INTERFACE_NWK_BOOTSRAP_PANA_AUTHENTICATION) {
109-
pana_reset_values(pan_id);
110-
}
111111

112112
if (cur->pana_sec_info_temp) {
113113
ns_dyn_mem_free(cur->pana_sec_info_temp);

source/6LoWPAN/MAC/mac_helper.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,9 @@ void mac_helper_coordinator_address_set(protocol_interface_info_entry_t *interfa
433433
if (adr_type == ADDR_802_15_4_SHORT) {
434434
memcpy(interface->mac_parameters->mac_cordinator_info.mac_mlme_coord_address, adr_ptr, 2);
435435
interface->mac_parameters->mac_cordinator_info.cord_adr_mode = MAC_ADDR_MODE_16_BIT;
436+
uint16_t short_addr = common_read_16_bit(interface->mac_parameters->mac_cordinator_info.mac_mlme_coord_address);
436437
set_req.attr = macCoordShortAddress;
437-
set_req.value_pointer = &interface->mac_parameters->mac_cordinator_info.mac_mlme_coord_address;
438+
set_req.value_pointer = &short_addr;
438439
set_req.value_size = 2;
439440
} else if (adr_type == ADDR_802_15_4_LONG) {
440441
memcpy(interface->mac_parameters->mac_cordinator_info.mac_mlme_coord_address, adr_ptr, 8);
@@ -767,8 +768,10 @@ static uint8_t mac_helper_header_security_aux_header_length(uint8_t keyIdmode) {
767768
switch (keyIdmode) {
768769
case MAC_KEY_ID_MODE_SRC8_IDX:
769770
header_length += 4; //64-bit key source first part
771+
/* fall through */
770772
case MAC_KEY_ID_MODE_SRC4_IDX:
771773
header_length += 4; //32-bit key source inline
774+
/* fall through */
772775
case MAC_KEY_ID_MODE_IDX:
773776
header_length += 1;
774777
break;
@@ -830,13 +833,13 @@ void mac_helper_devicetable_remove(mac_api_t *mac_api, uint8_t attribute_index)
830833
mac_api->mlme_req(mac_api,MLME_SET , &set_req);
831834
}
832835

833-
void mac_helper_devicetable_set(mle_neigh_table_entry_t *entry_temp, protocol_interface_info_entry_t *cur, uint32_t frame_counter, uint8_t keyID)
836+
void mac_helper_devicetable_set(mle_neigh_table_entry_t *entry_temp, protocol_interface_info_entry_t *cur, uint32_t frame_counter, uint8_t keyID, bool force_set)
834837
{
835838
if (!cur->mac_api) {
836839
return;
837840
}
838841

839-
if (cur->mac_parameters->SecurityEnabled && cur->mac_parameters->mac_default_key_index != keyID) {
842+
if (!force_set && cur->mac_parameters->SecurityEnabled && cur->mac_parameters->mac_default_key_index != keyID) {
840843
tr_debug("Do not set counter by index %u != %u", cur->mac_parameters->mac_default_key_index, keyID);
841844
return;
842845
}

source/6LoWPAN/MAC/mac_helper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ int8_t mac_helper_link_frame_counter_set(int8_t interface_id, uint32_t seq_ptr);
110110

111111
void mac_helper_devicetable_remove(struct mac_api_s *mac_api, uint8_t attribute_index);
112112

113-
void mac_helper_devicetable_set(struct mle_neigh_table_entry_t *entry_temp, struct protocol_interface_info_entry *cur, uint32_t frame_counter, uint8_t keyID);
113+
void mac_helper_devicetable_set(struct mle_neigh_table_entry_t *entry_temp, struct protocol_interface_info_entry *cur, uint32_t frame_counter, uint8_t keyID, bool force_set);
114114

115115
int8_t mac_helper_mac_mlme_max_retry_set(int8_t interface_id, uint8_t mac_retry_set);
116116

source/6LoWPAN/MAC/mac_pairwise_key.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ int mac_pairwise_key_interface_unregister(int8_t interface_id)
252252
int mac_pairwise_key_add(int8_t interface_id, uint32_t valid_life_time, const uint8_t eui64[static 8], const uint8_t key[static 16])
253253
{
254254
protocol_interface_info_entry_t *interface = protocol_stack_interface_info_get_by_id(interface_id);
255+
bool new_entry_created;
256+
255257
if (!interface || !interface->mac_api) {
256258
return -1;
257259
}
@@ -264,7 +266,7 @@ int mac_pairwise_key_add(int8_t interface_id, uint32_t valid_life_time, const ui
264266
}
265267

266268
//Allocate mle entry
267-
mle_neigh_table_entry_t *mle_entry = mle_class_get_entry_by_mac64(interface_id, 0, eui64, true);
269+
mle_neigh_table_entry_t *mle_entry = mle_class_get_entry_by_mac64(interface_id, 0, eui64, true, &new_entry_created);
268270
if (!mle_entry) {
269271
return -1;
270272
}
@@ -282,7 +284,7 @@ int mac_pairwise_key_add(int8_t interface_id, uint32_t valid_life_time, const ui
282284
}
283285

284286
//Set device descriptor
285-
mac_helper_devicetable_set(mle_entry, interface, 0, interface->mac_parameters->mac_default_key_index);
287+
mac_helper_devicetable_set(mle_entry, interface, 0, interface->mac_parameters->mac_default_key_index, new_entry_created);
286288

287289
//set key descriptor
288290
if (mac_helper_security_pairwisekey_set(interface, key, eui64, key_desc->key_decriptor_attribute) != 0) {
@@ -308,7 +310,7 @@ int mac_pairwise_key_del(int8_t interface_id, const uint8_t eui64[static 8])
308310
return -1;
309311
}
310312
//Get from mle
311-
mle_neigh_table_entry_t *mle_entry = mle_class_get_entry_by_mac64(interface_id, 0, eui64, true);
313+
mle_neigh_table_entry_t *mle_entry = mle_class_get_entry_by_mac64(interface_id, 0, eui64, true, NULL);
312314
if (!mle_entry) {
313315
return -1;
314316
}

source/6LoWPAN/Thread/thread_bbr_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ static bool thread_bbr_activated(thread_bbr_t *this, uint32_t seconds)
738738
return true;
739739
}
740740
// We will try to become router. This is done only in 120 seconds intervals if failed
741-
thread_router_bootstrap_router_id_request(cur, 0);
741+
thread_router_bootstrap_router_id_request(cur, THREAD_BBR_ROUTER_ID_REQUEST_STATUS);
742742
this->router_upgrade_delay_timer = 120;
743743
return false;
744744
}
@@ -755,8 +755,8 @@ bool thread_bbr_routing_enabled(protocol_interface_info_entry_t *cur)
755755

756756
void thread_bbr_network_data_update_notify(protocol_interface_info_entry_t *cur)
757757
{
758-
(void) cur;
759758
thread_mdns_network_data_update_notify();
759+
thread_extension_bbr_route_update(cur);
760760
}
761761
#endif /* HAVE_THREAD_BORDER_ROUTER*/
762762

0 commit comments

Comments
 (0)