Skip to content

Commit fddba1a

Browse files
committed
Add ipv6 empty address check logic (project-chip#182)
1 parent 6a20783 commit fddba1a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/platform/Tizen/DnssdImpl.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ using namespace chip::DeviceLayer::Internal;
4141

4242
namespace {
4343

44-
constexpr uint8_t kDnssdKeyMaxSize = 32;
44+
constexpr uint8_t kDnssdKeyMaxSize = 32;
45+
constexpr const char * kEmptyAddressIpv6 = "0000:0000:0000:0000:0000:0000:0000:0000";
4546

4647
// The number of miliseconds which must elapse without a new "found" event before
4748
// mDNS browsing is considered finished. We need this timeout because Tizen Native
@@ -325,7 +326,7 @@ void OnResolve(dnssd_error_e result, dnssd_service_h service, void * data)
325326
VerifyOrExit(ret == DNSSD_ERROR_NONE, ChipLogError(DeviceLayer, "dnssd_service_get_ip() failed. ret: %d", ret));
326327

327328
// If both IPv4 and IPv6 are set, IPv6 address has higher priority.
328-
if (ipv6 != nullptr)
329+
if (ipv6 != nullptr && strcmp(ipv6, kEmptyAddressIpv6) != 0)
329330
{
330331
if (!chip::Inet::IPAddress::FromString(ipv6, ipAddr) || ipAddr.Type() != chip::Inet::IPAddressType::kIPv6)
331332
{

0 commit comments

Comments
 (0)