File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
modules/openthread/platform Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -403,4 +403,23 @@ void mdns_plat_monitor_interface(struct net_if *ail_iface)
403
403
otPlatMdnsHandleHostAddressEvent (ot_instance_ptr , & ip6_addr , true,
404
404
ail_iface_index );
405
405
}
406
+
407
+ #if defined(CONFIG_NET_IPV4 ) && defined(CONFIG_NET_IPV4_MAPPING_TO_IPV6 )
408
+ struct net_if_ipv4 * ipv4 = NULL ;
409
+ otIp4Address ip4_addr = {0 };
410
+
411
+ ipv4 = ail_iface -> config .ip .ipv4 ;
412
+ ARRAY_FOR_EACH (ipv4 -> unicast , idx ) {
413
+ unicast = & ipv4 -> unicast [idx ].ipv4 ;
414
+
415
+ if (!unicast -> is_used ) {
416
+ continue ;
417
+ }
418
+ memcpy (& ip4_addr .mFields .m32 , & unicast -> address .in_addr .s4_addr32 ,
419
+ sizeof (otIp4Address ));
420
+ otIp4ToIp4MappedIp6Address (& ip4_addr , & ip6_addr );
421
+ otPlatMdnsHandleHostAddressEvent (ot_instance_ptr , & ip6_addr , true,
422
+ ail_iface_index );
423
+ }
424
+ #endif /* CONFIG_NET_IPV4 && CONFIG_NET_IPV4_MAPPING_TO_IPV6 */
406
425
}
You can’t perform that action at this time.
0 commit comments