Skip to content

Commit 7a5b2a7

Browse files
author
Juha Heiskanen
committed
Wi-sun State machine update
Fixed EAPOL missing EAPOL auhentication state set. Updated EAPOL parent scan print. Change-Id: Ibb8458fb4cd4761605e3826428c705d51e3155b5
1 parent bfc7843 commit 7a5b2a7

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -927,14 +927,14 @@ static void ws_bootstrap_pan_advertisement_analyse(struct protocol_interface_inf
927927
uint16_t pan_cost = (pan_information.routing_cost / PRC_WEIGHT_FACTOR) + (pan_information.pan_size / PS_WEIGHT_FACTOR);
928928
uint16_t current_pan_cost = (cur->ws_info->parent_info.pan_information.routing_cost / PRC_WEIGHT_FACTOR) + (cur->ws_info->parent_info.pan_information.pan_size / PS_WEIGHT_FACTOR);
929929
if (current_pan_cost < pan_cost) {
930-
tr_info("EAPOL target dropped Higher Pan cost");
930+
tr_info("EAPOL target dropped Higher Pan cost %u > %u current", pan_cost, current_pan_cost);
931931
return;
932932
}
933933

934934
// If pan cost is the same then we select the one we hear highest
935935
if (current_pan_cost == pan_cost &&
936936
cur->ws_info->parent_info.signal_dbm > data->signal_dbm) {
937-
tr_info("EAPOL target dropped Lower link quality");
937+
tr_info("EAPOL target dropped Lower link quality %u < %u current", data->signal_dbm, cur->ws_info->parent_info.signal_dbm);
938938
return;
939939
}
940940

@@ -2080,7 +2080,7 @@ void ws_bootstrap_event_configuration_start(protocol_interface_info_entry_t *cur
20802080
}
20812081
void ws_bootstrap_event_authentication_start(protocol_interface_info_entry_t *cur)
20822082
{
2083-
ws_bootsrap_event_trig(WS_AUTHENTICATION_START, cur->bootStrapId, ARM_LIB_LOW_PRIORITY_EVENT, NULL);
2083+
ws_bootstrap_state_change(cur, ER_PANA_AUTH);
20842084
}
20852085
void ws_bootstrap_event_operation_start(protocol_interface_info_entry_t *cur)
20862086
{
@@ -2336,21 +2336,6 @@ static void ws_bootstrap_event_handler(arm_event_s *event)
23362336
// Start network scan
23372337
ws_bootstrap_start_discovery(cur);
23382338
break;
2339-
case WS_AUTHENTICATION_START:
2340-
tr_info("authentication start");
2341-
// only advert sol stopped as we might be doing re authentication
2342-
cur->ws_info->trickle_pas_running = false;
2343-
//Add Test ecurity key and security level's
2344-
2345-
2346-
// Advertisements stopped during the EAPOL
2347-
cur->ws_info->trickle_pa_running = false;
2348-
cur->ws_info->trickle_pc_running = false;
2349-
cur->ws_info->trickle_pas_running = false;
2350-
cur->ws_info->trickle_pcs_running = false;
2351-
2352-
ws_bootstrap_start_authentication(cur);
2353-
break;
23542339

23552340
case WS_CONFIGURATION_START:
23562341
tr_info("Configuration start");
@@ -2512,6 +2497,7 @@ static void ws_bootstrap_state_change(protocol_interface_info_entry_t *cur, icmp
25122497
cur->bootsrap_state_machine_cnt = 1;
25132498
cur->nwk_bootstrap_state = nwk_bootstrap_state;
25142499
}
2500+
25152501
void ws_bootstrap_state_machine(protocol_interface_info_entry_t *cur)
25162502
{
25172503

@@ -2528,6 +2514,19 @@ void ws_bootstrap_state_machine(protocol_interface_info_entry_t *cur)
25282514
tr_debug("WS SM:configuration Scan");
25292515
ws_bootstrap_configure_process(cur);
25302516
break;
2517+
case ER_PANA_AUTH:
2518+
tr_info("authentication start");
2519+
// only advert sol stopped as we might be doing re authentication
2520+
cur->ws_info->trickle_pas_running = false;
2521+
//Add Test ecurity key and security level's
2522+
// Advertisements stopped during the EAPOL
2523+
cur->ws_info->trickle_pa_running = false;
2524+
cur->ws_info->trickle_pc_running = false;
2525+
cur->ws_info->trickle_pas_running = false;
2526+
cur->ws_info->trickle_pcs_running = false;
2527+
2528+
ws_bootstrap_start_authentication(cur);
2529+
break;
25312530
case ER_RPL_SCAN:
25322531
tr_debug("WS SM:Wait RPL to contact DODAG root");
25332532
ws_bootstrap_rpl_wait_process(cur);

source/6LoWPAN/ws/ws_bootstrap.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ typedef enum {
2323
WS_INIT_EVENT = 0, /**< tasklet initializion event*/
2424
WS_DISCOVERY_START, /**< discovery start*/
2525
WS_CONFIGURATION_START, /**< configuration learn start*/
26-
WS_AUTHENTICATION_START, /**< authentication start*/
2726
WS_OPERATION_START, /**< active operation start*/
2827
WS_ROUTING_READY, /**< RPL routing connected to BR*/
2928
WS_ADDRESS_ADDED /**< Address added to IF*/

0 commit comments

Comments
 (0)