From 7b48a4e2bce7ef1a4c4be772a83ea3b24f35fbdc Mon Sep 17 00:00:00 2001 From: "Deomid \"rojer\" Ryabkov" Date: Thu, 21 Sep 2023 22:28:01 +0100 Subject: [PATCH] DiscoveryImplPlatform: Only publish IPv6 address if IPv4 is disabled --- src/lib/dnssd/Discovery_ImplPlatform.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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;