@@ -2056,9 +2056,34 @@ static void thread_address_notification_cb(struct protocol_interface_info_entry
20562056 }
20572057}
20582058
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 )
20602060{
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+ }
20612084
2085+ void thread_mcast_group_change (struct protocol_interface_info_entry * interface , if_group_entry_t * group , bool addr_added )
2086+ {
20622087 if (thread_attach_ready (interface ) != 0 ) {
20632088 return ;
20642089 }
@@ -2067,7 +2092,7 @@ void thread_mcast_group_change(struct protocol_interface_info_entry *interface,
20672092
20682093 if (thread_bootstrap_should_register_address (interface )) {
20692094 /* 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 )) {
20712096 interface -> thread_info -> childUpdateReqTimer = 1 ;
20722097 }
20732098 } else {
0 commit comments