Skip to content

Commit

Permalink
Bootstrap and EAPOL treats all MAC TX failure causes similarly
Browse files Browse the repository at this point in the history
Previously only MLME_TX_NO_ACK failure cause on MPX data confirm callback
triggered parent change on bootstrap. Now all TX failures trigger parent
change. This harmonises the functionality and also corrects the problem
where neighbor was not added back to MAC after its entrys expiry and TX
failed with cause indicating that entry is not found.
  • Loading branch information
Mika Leppänen committed Feb 9, 2021
1 parent b57d9bc commit 85b949e
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Get and validate API for PHY mode ID and Channel plan ID.

### Bugfix
*
* All MAC TX failure causes now trigger target change on supplicant EAPOL inititial-key sending

## Release v12.8.1 (22-01-2021)

Expand Down
2 changes: 1 addition & 1 deletion source/6LoWPAN/ws/ws_bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -3097,7 +3097,7 @@ static void ws_bootstrap_authentication_completed(protocol_interface_info_entry_
if (result == AUTH_RESULT_OK) {
tr_debug("authentication success");
ws_bootstrap_event_configuration_start(cur);
} else if (result == AUTH_RESULT_ERR_TX_NO_ACK) {
} else if (result == AUTH_RESULT_ERR_TX_ERR) {
// eapol parent selected is not working
tr_debug("authentication TX failed");

Expand Down
2 changes: 1 addition & 1 deletion source/6LoWPAN/ws/ws_pae_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
typedef enum {
AUTH_RESULT_OK = 0, // Successful
AUTH_RESULT_ERR_NO_MEM = -1, // No memory
AUTH_RESULT_ERR_TX_NO_ACK = -2, // No acknowledge was received
AUTH_RESULT_ERR_TX_ERR = -2, // TX error (e.g. no acknowledge was received)
AUTH_RESULT_ERR_UNSPEC = -3 // Other reason
} auth_result_e;

Expand Down
4 changes: 2 additions & 2 deletions source/6LoWPAN/ws/ws_pae_supp.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ void ws_pae_supp_slow_timer(uint16_t seconds)
}
auth_result_e result = AUTH_RESULT_ERR_UNSPEC;
if (pae_supp->tx_failure_on_initial_key) {
result = AUTH_RESULT_ERR_TX_NO_ACK;
result = AUTH_RESULT_ERR_TX_ERR;
pae_supp->tx_failure_on_initial_key = false;
}
ws_pae_supp_authenticate_response(pae_supp, result);
Expand Down Expand Up @@ -1254,7 +1254,7 @@ static void ws_pae_supp_kmp_api_finished_indication(kmp_api_t *kmp, kmp_result_e

/* If initial EAPOL-key message sending fails to tx no acknowledge, indicates failure so
that bootstrap can decide if EAPOL target should be changed */
else if (type > IEEE_802_1X_INITIAL_KEY && result == KMP_RESULT_ERR_TX_NO_ACK) {
else if (type > IEEE_802_1X_INITIAL_KEY && (result == KMP_RESULT_ERR_TX_NO_ACK || result == KMP_RESULT_ERR_TX_UNSPEC)) {
tr_info("Initial EAPOL-Key TX failure, target: %s", trace_array(kmp_address_eui_64_get(&pae_supp->entry.addr), 8));
/* Fails authentication only if other authentication protocols are not yet
started by authenticator */
Expand Down
4 changes: 2 additions & 2 deletions source/Security/kmp/kmp_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ typedef enum {
typedef enum {
KMP_RESULT_OK = 0, // Successful
KMP_RESULT_ERR_NO_MEM = -1, // No memory
KMP_RESULT_ERR_TX_NO_ACK = -2, // No acknowledge was received
KMP_RESULT_ERR_UNSPEC = -3 // Other reason
KMP_RESULT_ERR_TX_NO_ACK = -2, // No TX acknowledge was received
KMP_RESULT_ERR_TX_UNSPEC = -3 // Other TX reason
} kmp_result_e;

typedef enum {
Expand Down
2 changes: 1 addition & 1 deletion source/Security/protocols/key_sec_prot/key_sec_prot.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ static int8_t key_sec_prot_tx_status_ind(sec_prot_t *prot, sec_prot_tx_status_e
sec_prot_result_set(&data->common, SEC_RESULT_ERR_TX_NO_ACK);
} else if (tx_status != SEC_PROT_TX_OK) {
// Indicates other failure
sec_prot_result_set(&data->common, SEC_RESULT_ERR_UNSPEC);
sec_prot_result_set(&data->common, SEC_RESULT_ERR_TX_UNSPEC);
}
prot->state_machine_call(prot);
return 0;
Expand Down
2 changes: 1 addition & 1 deletion source/Security/protocols/sec_prot.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ typedef enum {
SEC_RESULT_OK = 0,
SEC_RESULT_ERR_NO_MEM = -1,
SEC_RESULT_ERR_TX_NO_ACK = -2,
SEC_RESULT_ERR_UNSPEC = -3,
SEC_RESULT_ERR_TX_UNSPEC = -3,
SEC_RESULT_TIMEOUT = -4,
SEC_RESULT_ERROR = -5,
SEC_RESULT_CONF_ERROR = -6,
Expand Down

0 comments on commit 85b949e

Please sign in to comment.