Skip to content

Commit f298cd3

Browse files
author
Juha Heiskanen
committed
Parent synch fix and EAPOL synch fix
EAPOL authenticator add now BT-IE to every message. EAPOL parent synch is now done fully only first time otherwise it will be done just soft update. Fixed FHSS default set write. Change-Id: Ia03f628b2856e771e7f0bbc0860ce6c3be223b1a
1 parent 02942b0 commit f298cd3

File tree

5 files changed

+19
-14
lines changed

5 files changed

+19
-14
lines changed

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ static void ws_bootstrap_primary_parent_set(struct protocol_interface_info_entry
520520

521521
// Learning broadcast network configuration
522522
if (neighbor_info->ws_neighbor->broadcast_shedule_info_stored) {
523-
if (synch_req == WS_EAPOL_PARENT_SYNCH) {
523+
if (synch_req != WS_EAPOL_PARENT_SYNCH) {
524524
ws_fhss_set_defaults(cur, &fhss_configuration);
525525
}
526526
fhss_configuration.ws_bc_channel_function = (fhss_ws_channel_functions)neighbor_info->ws_neighbor->fhss_data.bc_timing_info.broadcast_channel_function;
@@ -532,7 +532,7 @@ static void ws_bootstrap_primary_parent_set(struct protocol_interface_info_entry
532532
fhss_configuration.fhss_bc_dwell_interval = neighbor_info->ws_neighbor->fhss_data.bc_timing_info.broadcast_dwell_interval;
533533
fhss_configuration.fhss_broadcast_interval = neighbor_info->ws_neighbor->fhss_data.bc_timing_info.broadcast_interval;
534534
fhss_configuration.broadcast_fixed_channel = cur->ws_info->fhss_bc_fixed_channel;
535-
535+
neighbor_info->ws_neighbor->synch_done = true;
536536
}
537537

538538
ns_fhss_ws_configuration_set(cur->ws_info->fhss_api, &fhss_configuration);
@@ -544,9 +544,9 @@ static void ws_bootstrap_primary_parent_set(struct protocol_interface_info_entry
544544
ws_bootstrap_llc_hopping_update(cur, &fhss_configuration);
545545
}
546546

547-
void ws_bootstrap_eapol_parent_synch(struct protocol_interface_info_entry *cur, llc_neighbour_req_t *neighbor_info, ws_bs_ie_t *ws_bs_ie)
547+
void ws_bootstrap_eapol_parent_synch(struct protocol_interface_info_entry *cur, llc_neighbour_req_t *neighbor_info)
548548
{
549-
if (neighbor_info->ws_neighbor->broadcast_shedule_info_stored || cur->ws_info->configuration_learned) {
549+
if (cur->ws_info->configuration_learned || !neighbor_info->ws_neighbor->broadcast_shedule_info_stored || !neighbor_info->ws_neighbor->broadcast_timing_info_stored ) {
550550
return;
551551
}
552552

@@ -555,9 +555,11 @@ void ws_bootstrap_eapol_parent_synch(struct protocol_interface_info_entry *cur,
555555
}
556556

557557
//Store Brodacst Shedule
558-
ws_neighbor_class_neighbor_broadcast_schedule_set(neighbor_info->ws_neighbor, ws_bs_ie);
559-
560-
ws_bootstrap_primary_parent_set(cur, neighbor_info, WS_EAPOL_PARENT_SYNCH);
558+
if (!neighbor_info->ws_neighbor->synch_done) {
559+
ws_bootstrap_primary_parent_set(cur, neighbor_info, WS_EAPOL_PARENT_SYNCH);
560+
} else {
561+
ns_fhss_ws_set_parent(cur->ws_info->fhss_api, neighbor_info->neighbor->mac64, &neighbor_info->ws_neighbor->fhss_data.bc_timing_info, false);
562+
}
561563
}
562564

563565
static void ws_bootstrap_ll_address_validate(struct protocol_interface_info_entry *cur)

source/6LoWPAN/ws/ws_bootstrap.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ typedef enum {
3232
#ifdef HAVE_WS
3333

3434
struct llc_neighbour_req;
35-
struct ws_bs_ie;
3635

3736
int ws_bootstrap_init(int8_t interface_id, net_6lowpan_mode_e bootstrap_mode);
3837

@@ -75,7 +74,7 @@ void ws_dhcp_client_address_delete(protocol_interface_info_entry_t *cur, uint8_t
7574

7675
bool ws_eapol_relay_state_active(protocol_interface_info_entry_t *cur);
7776

78-
void ws_bootstrap_eapol_parent_synch(struct protocol_interface_info_entry *cur, struct llc_neighbour_req *neighbor_info, struct ws_bs_ie *ws_bs_ie);
77+
void ws_bootstrap_eapol_parent_synch(struct protocol_interface_info_entry *cur, struct llc_neighbour_req *neighbor_info);
7978

8079
#else
8180

source/6LoWPAN/ws/ws_llc_data_service.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -539,18 +539,21 @@ static void ws_llc_mac_indication_cb(const mac_api_t *api, const mcps_data_ind_t
539539
if (ws_wh_ea_read(ie_ext->headerIeList, ie_ext->headerIeListLength, auth_eui64)) {
540540
ws_pae_controller_border_router_addr_write(base->interface_ptr, auth_eui64);
541541
}
542+
if (bs_ie_inline) {
543+
ws_neighbor_class_neighbor_broadcast_schedule_set(neighbor_info.ws_neighbor, &ws_bs_ie);
544+
}
542545
}
543546

547+
544548
//Update BT if it is part of message
545549
ws_bt_ie_t ws_bt;
546550
if (ws_wh_bt_read(ie_ext->headerIeList, ie_ext->headerIeListLength, &ws_bt)) {
547551
ws_neighbor_class_neighbor_broadcast_time_info_update(neighbor_info.ws_neighbor, &ws_bt, data->timestamp);
548552
if (neighbor_info.neighbor->link_role == PRIORITY_PARENT_NEIGHBOUR) {
549553
// We have broadcast schedule set up set the broadcast parent schedule
550554
ns_fhss_ws_set_parent(interface->ws_info->fhss_api, neighbor_info.neighbor->mac64, &neighbor_info.ws_neighbor->fhss_data.bc_timing_info, false);
551-
} else if (ws_utt.message_type == WS_FT_EAPOL && bs_ie_inline) {
552-
//Synch Broadcast Only 1 time when configuration is not learned
553-
ws_bootstrap_eapol_parent_synch(interface, &neighbor_info, &ws_bs_ie);
555+
} else if (ws_utt.message_type == WS_FT_EAPOL) {
556+
ws_bootstrap_eapol_parent_synch(interface, &neighbor_info);
554557
}
555558
}
556559

@@ -685,8 +688,8 @@ static void ws_llc_mpx_data_request(const mpx_api_t *api, const struct mcps_data
685688
nested_wp_id.vp_ie = true;
686689
}
687690
} else if (user_id == MPX_KEY_MANAGEMENT_ENC_USER_ID) {
691+
ie_header_mask.bt_ie = ws_eapol_relay_state_active(base->interface_ptr);
688692
ie_header_mask.ea_ie = ws_eapol_handshake_first_msg(data->msdu, data->msduLength, base->interface_ptr);
689-
ie_header_mask.bt_ie = ie_header_mask.ea_ie;
690693
nested_wp_id.bs_ie = ie_header_mask.ea_ie;
691694

692695
}

source/6LoWPAN/ws/ws_neighbor_class.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ typedef struct ws_neighbor_class_entry {
3131
bool candidate_parent: 1;
3232
bool broadcast_timing_info_stored: 1;
3333
bool broadcast_shedule_info_stored: 1;
34+
bool synch_done : 1;
3435
} ws_neighbor_class_entry_t;
3536

3637
/**

test/nanostack/unittest/stub/ws_bootstrap_stub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ bool ws_eapol_relay_state_active(protocol_interface_info_entry_t *cur)
116116
return false;
117117
}
118118

119-
void ws_bootstrap_eapol_parent_synch(struct protocol_interface_info_entry *cur, llc_neighbour_req_t *neighbor_info, ws_bs_ie_t *ws_bs_ie)
119+
void ws_bootstrap_eapol_parent_synch(struct protocol_interface_info_entry *cur, llc_neighbour_req_t *neighbor_info)
120120
{
121121

122122
}

0 commit comments

Comments
 (0)