diff --git a/src/platform/Zephyr/DiagnosticDataProviderImpl.cpp b/src/platform/Zephyr/DiagnosticDataProviderImpl.cpp index 9398359f1cb021..a735d3e0162b79 100644 --- a/src/platform/Zephyr/DiagnosticDataProviderImpl.cpp +++ b/src/platform/Zephyr/DiagnosticDataProviderImpl.cpp @@ -282,8 +282,23 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** ifp->offPremiseServicesReachableIPv4.SetNull(); ifp->offPremiseServicesReachableIPv6.SetNull(); + CHIP_ERROR error; uint8_t addressSize; - if (interfaceIterator.GetHardwareAddress(ifp->MacAddress, addressSize, sizeof(ifp->MacAddress)) != CHIP_NO_ERROR) + +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD + if (interfaceType == Inet::InterfaceType::Thread) + { + static_assert(OT_EXT_ADDRESS_SIZE <= sizeof(ifp->MacAddress), "Unexpected extended address size"); + error = ThreadStackMgr().GetPrimary802154MACAddress(ifp->MacAddress); + addressSize = OT_EXT_ADDRESS_SIZE; + } + else +#endif + { + error = interfaceIterator.GetHardwareAddress(ifp->MacAddress, addressSize, sizeof(ifp->MacAddress)); + } + + if (error != CHIP_NO_ERROR) { ChipLogError(DeviceLayer, "Failed to get network hardware address"); }