Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dnssd] fix minimal mDNS resolver issues #11963

Merged
merged 1 commit into from
Nov 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/lib/dnssd/Resolver_ImplMinimalMdns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ void PacketDataReporter::OnOperationalIPAddress(const chip::Inet::IPAddress & ad
// This code assumes that all entries in the mDNS packet relate to the
// same entity. This may not be correct if multiple servers are reported
// (if multi-admin decides to use unique ports for every ecosystem).
mNodeData.mAddress[mDiscoveredNodeData.numIPs++] = addr;
mNodeData.mInterfaceId = mInterfaceId;
mHasIP = true;
mNodeData.mAddress[mNodeData.mNumIPs++] = addr;
mNodeData.mInterfaceId = mInterfaceId;
mHasIP = true;
}

void PacketDataReporter::OnDiscoveredNodeIPAddress(const chip::Inet::IPAddress & addr)
Expand Down Expand Up @@ -402,13 +402,13 @@ CHIP_ERROR MinMdnsResolver::Init(chip::Inet::InetLayer * inetLayer)
{
/// Note: we do not double-check the port as we assume the APP will always use
/// the same inetLayer and port for mDNS.
mSystemLayer = inetLayer->SystemLayer();

if (GlobalMinimalMdnsServer::Server().IsListening())
{
return CHIP_NO_ERROR;
}

mSystemLayer = inetLayer->SystemLayer();

return GlobalMinimalMdnsServer::Instance().StartServer(inetLayer, kMdnsPort);
}

Expand Down