Skip to content

Commit ea93c1f

Browse files
author
Kari Severinkangas
authored
Thread dev conf taken use (ARMmbed#1503)
move ext_mac and ml_eid from link conf to dev conf
1 parent 5d5b239 commit ea93c1f

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

nanostack/thread_management_if.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ typedef struct link_configuration {
7474
uint8_t master_key[16]; /**< Master key of the thread network*/
7575
uint8_t PSKc[16]; /**< PSKc value that is calculated from commissioning credentials credentials,XPANID and network name*/
7676
uint8_t mesh_local_ula_prefix[8]; /**< Mesh local ula prefix*/
77-
uint8_t mesh_local_eid[8]; /**< Mesh local extented id*/
7877
uint8_t extented_pan_id[8]; /**< Extended pan id*/
79-
uint8_t extended_random_mac[8]; /**< Extended random mac which is generated during commissioning*/
8078
uint8_t channel_mask[8]; /**< channel page and mask only supported is page 0*/
8179
uint8_t channel_page;/**< channel page supported pages 0*/
8280
char *PSKc_ptr; /**< Commissioning credentials. TODO! think if we need the actual credentials*/

source/6LoWPAN/Thread/thread_joiner_application.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,6 @@ static void link_configuration_copy(link_configuration_s *this, link_configurati
335335
if (!this || !configuration_ptr) {
336336
return;
337337
}
338-
339-
memcpy(this->extended_random_mac, configuration_ptr->extended_random_mac, 8);
340-
memcpy(this->mesh_local_eid, configuration_ptr->mesh_local_eid,5);
341338
memcpy(this->name, configuration_ptr->name, 16);
342339
memcpy(this->PSKc, configuration_ptr->PSKc, 16);
343340
memcpy(this->master_key, configuration_ptr->master_key, 16);
@@ -871,32 +868,23 @@ void thread_joiner_application_nvm_delete_callback(int status, void *context)
871868

872869
static void thread_joiner_application_validate_settings(thread_joiner_t *this)
873870
{
874-
if (memcmp(this->device_configuration_ptr->extended_random_mac,ADDR_UNSPECIFIED, 8) == 0) {
875-
memcpy(this->device_configuration_ptr->extended_random_mac,this->configuration_ptr->extended_random_mac,8);
876-
}
877871
if (memcmp(this->device_configuration_ptr->extended_random_mac,ADDR_UNSPECIFIED, 8) == 0) {
878872
randLIB_get_n_bytes_random(this->device_configuration_ptr->extended_random_mac, 8);
879873
this->device_configuration_ptr->extended_random_mac[0] |= 2; //Set Local Bit
880874
this->device_configuration_ptr->extended_random_mac[0] &= ~1; //Clear multicast bit
881875
tr_info("Generating Random MAC");
882-
memcpy(this->configuration_ptr->extended_random_mac,this->device_configuration_ptr->extended_random_mac,8);
883-
}
884-
if (memcmp(this->device_configuration_ptr->mesh_local_eid,ADDR_UNSPECIFIED,8)==0){
885-
memcpy(this->device_configuration_ptr->mesh_local_eid,this->configuration_ptr->mesh_local_eid,8);
886876
}
887877
while (addr_iid_reserved(this->device_configuration_ptr->mesh_local_eid) ||
888878
memcmp(this->device_configuration_ptr->mesh_local_eid, ADDR_SHORT_ADR_SUFFIC,6) == 0 ) {
889879
// addr_iid_reserved checks the all zeroes case.
890880
randLIB_get_n_bytes_random(this->device_configuration_ptr->mesh_local_eid, 8);
891881
tr_info("Generating Random ML-EID");
892-
memcpy(this->configuration_ptr->mesh_local_eid,this->device_configuration_ptr->mesh_local_eid,8);
893882
}
894883
if (this->configuration_ptr->key_rotation < 3600) {
895884
this->configuration_ptr->key_rotation = 3600;
896885
}
897886
}
898887

899-
900888
int thread_joiner_application_init(int8_t interface_id, device_configuration_s *device_configuration_ptr, link_configuration_s *default_configuration_ptr)
901889
{
902890
thread_joiner_t *this;

0 commit comments

Comments
 (0)