diff --git a/src/lib/dnssd/Discovery_ImplPlatform.cpp b/src/lib/dnssd/Discovery_ImplPlatform.cpp index b3fc61914a5c4d..4633ec04a0d01f 100644 --- a/src/lib/dnssd/Discovery_ImplPlatform.cpp +++ b/src/lib/dnssd/Discovery_ImplPlatform.cpp @@ -508,7 +508,11 @@ CHIP_ERROR DiscoveryImplPlatform::PublishService(const char * serviceType, TextE ? MakeInstanceName(service.mName, sizeof(service.mName), peerId) : GetCommissionableInstanceName(service.mName, sizeof(service.mName))); Platform::CopyString(service.mType, serviceType); +#if INET_CONFIG_ENABLE_IPV4 service.mAddressType = Inet::IPAddressType::kAny; +#else + service.mAddressType = Inet::IPAddressType::kIPv6; +#endif service.mInterface = interfaceId; service.mProtocol = protocol; service.mPort = port;