@@ -2056,9 +2056,34 @@ static void thread_address_notification_cb(struct protocol_interface_info_entry
2056
2056
}
2057
2057
}
2058
2058
2059
- void thread_mcast_group_change (struct protocol_interface_info_entry * interface , if_group_entry_t * group , bool addr_added )
2059
+ static bool thread_mcast_should_register_address (struct protocol_interface_info_entry * cur , uint8_t * addr )
2060
2060
{
2061
+ uint8_t thread_realm_local_mcast_addr [16 ];
2062
+ uint8_t thread_ll_unicast_prefix_based_mcast_addr [16 ];
2063
+ thread_bootstrap_all_nodes_address_generate (thread_realm_local_mcast_addr , cur -> thread_info -> threadPrivatePrefixInfo .ulaPrefix , IPV6_SCOPE_REALM_LOCAL );
2064
+ thread_bootstrap_all_nodes_address_generate (thread_ll_unicast_prefix_based_mcast_addr , cur -> thread_info -> threadPrivatePrefixInfo .ulaPrefix , IPV6_SCOPE_LINK_LOCAL );
2065
+ if (addr_ipv6_multicast_scope (addr ) >= IPV6_SCOPE_LINK_LOCAL ) {
2066
+ if (memcmp (addr , ADDR_MULTICAST_SOLICITED , 13 ) == 0 ) {
2067
+ return false;
2068
+ }
2069
+ if (memcmp (addr , thread_realm_local_mcast_addr , 16 ) == 0 ) {
2070
+ return false;
2071
+ }
2072
+ if (memcmp (addr , thread_ll_unicast_prefix_based_mcast_addr , 16 ) == 0 ) {
2073
+ return false;
2074
+ }
2075
+ if (memcmp (addr , ADDR_LINK_LOCAL_ALL_NODES , 16 ) == 0 ) {
2076
+ return false;
2077
+ }
2078
+ if (memcmp (addr , ADDR_LINK_LOCAL_ALL_ROUTERS , 16 ) == 0 ) {
2079
+ return false;
2080
+ }
2081
+ }
2082
+ return true;
2083
+ }
2061
2084
2085
+ void thread_mcast_group_change (struct protocol_interface_info_entry * interface , if_group_entry_t * group , bool addr_added )
2086
+ {
2062
2087
if (thread_attach_ready (interface ) != 0 ) {
2063
2088
return ;
2064
2089
}
@@ -2067,7 +2092,7 @@ void thread_mcast_group_change(struct protocol_interface_info_entry *interface,
2067
2092
2068
2093
if (thread_bootstrap_should_register_address (interface )) {
2069
2094
/* Trigger Child Update Request only if MTD child's multicast address change */
2070
- if (addr_ipv6_multicast_scope ( group -> group ) >= IPV6_SCOPE_LINK_LOCAL ) {
2095
+ if (thread_mcast_should_register_address ( interface , group -> group )) {
2071
2096
interface -> thread_info -> childUpdateReqTimer = 1 ;
2072
2097
}
2073
2098
} else {
0 commit comments