From 986888913be806a2ca7e6d85d8a144c31f60e787 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Wed, 9 Jun 2021 21:28:18 +0200 Subject: [PATCH] Darwin - Pass the port advertised by mdns in network byte order (#7487) --- src/platform/Darwin/MdnsImpl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform/Darwin/MdnsImpl.cpp b/src/platform/Darwin/MdnsImpl.cpp index 74785c13feeb8e..d2fd85fd719c2b 100644 --- a/src/platform/Darwin/MdnsImpl.cpp +++ b/src/platform/Darwin/MdnsImpl.cpp @@ -322,8 +322,8 @@ CHIP_ERROR Register(uint32_t interfaceId, const char * type, const char * name, } sdCtx = chip::Platform::New(type, nullptr); - err = DNSServiceRegister(&sdRef, 0 /* flags */, interfaceId, name, type, kLocalDomain, NULL, port, recordLen, recordBytesPtr, - OnRegister, sdCtx); + err = DNSServiceRegister(&sdRef, 0 /* flags */, interfaceId, name, type, kLocalDomain, NULL, ntohs(port), recordLen, + recordBytesPtr, OnRegister, sdCtx); TXTRecordDeallocate(recordRef); VerifyOrReturnError(CheckForSuccess(sdCtx, __func__, err), CHIP_ERROR_INTERNAL);