Skip to content

Commit

Permalink
fed advertisement fix (ARMmbed#1795)
Browse files Browse the repository at this point in the history
fixed a bug where fed sent an advertisement 
when it heard a lower partition advertisement.
  • Loading branch information
deepakvenugopal authored Aug 24, 2018
1 parent b3139c8 commit 5bbc86f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion source/6LoWPAN/Thread/thread_router_bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2325,7 +2325,6 @@ static uint32_t thread_reed_timeout_calculate(thread_router_select_t *routerSele
static int thread_reed_advertise (protocol_interface_info_entry_t *cur)
{
uint32_t keySequence;
tr_debug("MLE REED ADVERTISEMENT STARTED");
struct link_configuration *linkConfiguration;
linkConfiguration = thread_joiner_application_get_config(cur->id);
if (!linkConfiguration) {
Expand All @@ -2336,11 +2335,17 @@ static int thread_reed_advertise (protocol_interface_info_entry_t *cur)
return -1;
}

// FED not allowed to send advertisements
if (thread_info(cur)->thread_device_mode == THREAD_DEVICE_MODE_FULL_END_DEVICE) {
return -1;
}

uint16_t bufId = mle_service_msg_allocate(cur->id, 16, false, MLE_COMMAND_ADVERTISEMENT);
if (bufId == 0) {
return -1;
}

tr_debug("MLE REED ADVERTISEMENT STARTED");
thread_management_get_current_keysequence(cur->id, &keySequence);
mle_service_msg_update_security_params(bufId, 5, 2, keySequence);

Expand Down

0 comments on commit 5bbc86f

Please sign in to comment.