From 3290439413c75a0a3e8997a31f2e0128592d6526 Mon Sep 17 00:00:00 2001 From: Deomid Ryabkov Date: Fri, 22 Sep 2023 14:37:31 +0100 Subject: [PATCH] DiscoveryImplPlatform: Only publish IPv6 address if IPv4 is disabled (#29399) --- src/lib/dnssd/Discovery_ImplPlatform.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/dnssd/Discovery_ImplPlatform.cpp b/src/lib/dnssd/Discovery_ImplPlatform.cpp index b3fc61914a5c4d..88cafdebd2c0e1 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); - service.mAddressType = Inet::IPAddressType::kAny; +#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;