Skip to content

Commit

Permalink
Address registration fix (ARMmbed#1882)
Browse files Browse the repository at this point in the history
skipped triggering of child update request for
known multicast addresses, removed multicast
entries before processing new address registration
tlv.
  • Loading branch information
deepakvenugopal authored Oct 29, 2018
1 parent e7a8d45 commit 1ef5062
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
29 changes: 27 additions & 2 deletions source/6LoWPAN/Thread/thread_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -2056,9 +2056,34 @@ static void thread_address_notification_cb(struct protocol_interface_info_entry
}
}

void thread_mcast_group_change(struct protocol_interface_info_entry *interface, if_group_entry_t *group, bool addr_added)
static bool thread_mcast_should_register_address(struct protocol_interface_info_entry *cur, uint8_t *addr)
{
uint8_t thread_realm_local_mcast_addr[16];
uint8_t thread_ll_unicast_prefix_based_mcast_addr[16];
thread_bootstrap_all_nodes_address_generate(thread_realm_local_mcast_addr, cur->thread_info->threadPrivatePrefixInfo.ulaPrefix, IPV6_SCOPE_REALM_LOCAL);
thread_bootstrap_all_nodes_address_generate(thread_ll_unicast_prefix_based_mcast_addr, cur->thread_info->threadPrivatePrefixInfo.ulaPrefix, IPV6_SCOPE_LINK_LOCAL);
if (addr_ipv6_multicast_scope(addr) >= IPV6_SCOPE_LINK_LOCAL) {
if (memcmp(addr, ADDR_MULTICAST_SOLICITED, 13) == 0) {
return false;
}
if (memcmp(addr, thread_realm_local_mcast_addr, 16) == 0) {
return false;
}
if (memcmp(addr, thread_ll_unicast_prefix_based_mcast_addr, 16) == 0) {
return false;
}
if (memcmp(addr, ADDR_LINK_LOCAL_ALL_NODES, 16) == 0) {
return false;
}
if (memcmp(addr, ADDR_LINK_LOCAL_ALL_ROUTERS, 16) == 0) {
return false;
}
}
return true;
}

void thread_mcast_group_change(struct protocol_interface_info_entry *interface, if_group_entry_t *group, bool addr_added)
{
if (thread_attach_ready(interface) != 0) {
return;
}
Expand All @@ -2067,7 +2092,7 @@ void thread_mcast_group_change(struct protocol_interface_info_entry *interface,

if (thread_bootstrap_should_register_address(interface)) {
/* Trigger Child Update Request only if MTD child's multicast address change */
if (addr_ipv6_multicast_scope(group->group) >= IPV6_SCOPE_LINK_LOCAL) {
if (thread_mcast_should_register_address(interface, group->group)) {
interface->thread_info->childUpdateReqTimer = 1;
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion source/6LoWPAN/Thread/thread_router_bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,7 @@ static void thread_address_registration_tlv_parse(uint8_t *ptr, uint16_t data_le
uint8_t tempIPv6Address[16];
uint8_t ctxId;
bool new_neighbour_created;

thread_child_mcast_entries_remove(cur,mac64);
while (data_length) {
//Read
ctxId = *ptr++;
Expand Down

0 comments on commit 1ef5062

Please sign in to comment.