Skip to content

Commit 5bbc86f

Browse files
fed advertisement fix (ARMmbed#1795)
fixed a bug where fed sent an advertisement when it heard a lower partition advertisement.
1 parent b3139c8 commit 5bbc86f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

source/6LoWPAN/Thread/thread_router_bootstrap.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2325,7 +2325,6 @@ static uint32_t thread_reed_timeout_calculate(thread_router_select_t *routerSele
23252325
static int thread_reed_advertise (protocol_interface_info_entry_t *cur)
23262326
{
23272327
uint32_t keySequence;
2328-
tr_debug("MLE REED ADVERTISEMENT STARTED");
23292328
struct link_configuration *linkConfiguration;
23302329
linkConfiguration = thread_joiner_application_get_config(cur->id);
23312330
if (!linkConfiguration) {
@@ -2336,11 +2335,17 @@ static int thread_reed_advertise (protocol_interface_info_entry_t *cur)
23362335
return -1;
23372336
}
23382337

2338+
// FED not allowed to send advertisements
2339+
if (thread_info(cur)->thread_device_mode == THREAD_DEVICE_MODE_FULL_END_DEVICE) {
2340+
return -1;
2341+
}
2342+
23392343
uint16_t bufId = mle_service_msg_allocate(cur->id, 16, false, MLE_COMMAND_ADVERTISEMENT);
23402344
if (bufId == 0) {
23412345
return -1;
23422346
}
23432347

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

0 commit comments

Comments
 (0)