Skip to content

Commit

Permalink
address registration tlv check only for MTDs (ARMmbed#1855)
Browse files Browse the repository at this point in the history
  • Loading branch information
deepakvenugopal authored Oct 9, 2018
1 parent 942d8e7 commit 3c1864b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions source/6LoWPAN/Thread/thread_host_bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,15 +326,18 @@ static int thread_end_device_synch_response_validate(protocol_interface_info_ent
!mle_tlv_read_16_bit_tlv(MLE_TYPE_SRC_ADDRESS, ptr, data_length, &srcAddress) ||
!mle_tlv_read_16_bit_tlv(MLE_TYPE_ADDRESS16, ptr, data_length, &address16) ||
!thread_leader_data_parse(ptr, data_length, &leaderData) ||
!mle_tlv_read_32_bit_tlv(MLE_TYPE_LL_FRAME_COUNTER, ptr, data_length, &llFrameCounter) ||
!mle_tlv_read_tlv(MLE_TYPE_ADDRESS_REGISTRATION, ptr, data_length, &addressRegisteredTlv)) {
!mle_tlv_read_32_bit_tlv(MLE_TYPE_LL_FRAME_COUNTER, ptr, data_length, &llFrameCounter)) {
tr_debug("missing TLV's");
return -1;
}

// check for presence of Address registration TLV
if (addressRegisteredTlv.tlvLen == 0) {
return -1;
if (!(mode & THREAD_DEVICE_FED)) {
// check for presence of Address registration TLV for MTDs
if (!mle_tlv_read_tlv(MLE_TYPE_ADDRESS_REGISTRATION, ptr, data_length, &addressRegisteredTlv) ||
(addressRegisteredTlv.tlvLen == 0)) {
tr_debug("MTD missed address registration TLV - reattach");
return -1;
}
}

// check if the source address is a router address
Expand Down

0 comments on commit 3c1864b

Please sign in to comment.