Skip to content

Commit

Permalink
[Tizen] Add ipv6 empty address check logic (#182) (#23455)
Browse files Browse the repository at this point in the history
  • Loading branch information
2 people authored and pull[bot] committed Sep 15, 2023
1 parent 9b98a7a commit 1032482
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/platform/Tizen/DnssdImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ using namespace chip::DeviceLayer::Internal;

namespace {

constexpr uint8_t kDnssdKeyMaxSize = 32;
constexpr uint8_t kDnssdKeyMaxSize = 32;
constexpr const char * kEmptyAddressIpv6 = "0000:0000:0000:0000:0000:0000:0000:0000";

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

// If both IPv4 and IPv6 are set, IPv6 address has higher priority.
if (ipv6 != nullptr)
if (ipv6 != nullptr && strcmp(ipv6, kEmptyAddressIpv6) != 0)
{
if (!chip::Inet::IPAddress::FromString(ipv6, ipAddr) || ipAddr.Type() != chip::Inet::IPAddressType::kIPv6)
{
Expand Down

0 comments on commit 1032482

Please sign in to comment.