Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 16a1bc5

Browse files
Juha Heiskanenjuhhei01
authored andcommitted
MLE bootsrap and message timeout update
Fixed that MLE router synch can fail. Added more time for unicast and multicast messages. (cherry picked from commit 2c2053bc3237c9db40832b66e5881d800f98b8e8)
1 parent eeb2d39 commit 16a1bc5

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -663,17 +663,17 @@ static uint16_t mle_router_synch(protocol_interface_info_entry_t *cur, const uin
663663
if (retrans) {
664664
if (destAddress) {
665665
timeout.retrans_max = 3;
666-
timeout.timeout_init = 1;
667-
timeout.timeout_max = 3;
666+
timeout.timeout_init = 2;
667+
timeout.timeout_max = 4;
668668
} else {
669669
timeout.retrans_max = 2;
670-
timeout.timeout_init = 2;
670+
timeout.timeout_init = 4;
671671
timeout.timeout_max = 4;
672672
}
673673
} else {
674674
timeout.retrans_max = 1;
675-
timeout.timeout_init = 1;
676-
timeout.timeout_max = 3;
675+
timeout.timeout_init = 2;
676+
timeout.timeout_max = 4;
677677
}
678678

679679
timeout.delay = delay;
@@ -706,7 +706,7 @@ static int mle_router_accept_request_build(protocol_interface_info_entry_t *cur,
706706
bufId = mle_service_msg_allocate(cur->id, 64, true,type);
707707
timeout.retrans_max = 2;
708708
timeout.timeout_init = 2;
709-
timeout.timeout_max = 2;
709+
timeout.timeout_max = 4;
710710
}
711711

712712
if (bufId == 0) {
@@ -840,12 +840,14 @@ static bool mle_parent_link_req_cb(int8_t interface_id, uint16_t msgId, bool use
840840
if (usedAllRetries) {
841841
switch (cur->nwk_bootstrap_state) {
842842
case ER_MLE_LINK_REQ:
843-
case ER_ROUTER_SYNCH:
844843
case ER_MLE_LINK_ADDRESS_SYNCH:
845844
case ER_MLE_LINK_SHORT_SYNCH:
846845
tr_debug("Link synch fail %u", cur->nwk_bootstrap_state);
847846
bootsrap_next_state_kick(ER_BOOTSTRAP_CONNECTION_DOWN, cur);
848847
break;
848+
case ER_ROUTER_SYNCH:
849+
bootsrap_next_state_kick(ER_RPL_MC, cur);
850+
break;
849851
default:
850852
break;
851853
}
@@ -869,6 +871,7 @@ static bool mle_accept_request_cb(int8_t interface_id, uint16_t msgId, bool used
869871
//If message has been sent by MLE service sends MLE reject to clear link
870872
if (mle_service_check_msg_sent(msgId)) {
871873
uint8_t *address_ptr = mle_service_get_msg_destination_address_pointer(msgId);
874+
tr_debug("No accept for Accept/Request");
872875
mle_service_reject_message_build(cur->id, address_ptr, false);
873876
}
874877
return false;
@@ -2728,6 +2731,7 @@ static void protocol_6lowpan_generate_link_reject(protocol_interface_info_entry_
27282731
address[8] ^= 2;
27292732
}
27302733
if (mac_helper_default_security_level_get(cur)) {
2734+
tr_debug("Drop link by asymmetric security");
27312735
mle_service_reject_message_build(cur->id, address, false);
27322736
return;
27332737
}

0 commit comments

Comments
 (0)