Skip to content

Commit

Permalink
[mdns] Show interface on mDns failures. (#15266)
Browse files Browse the repository at this point in the history
* [mdns] Show interface on mDns failures.

* [log] Deescalate bad interface log from error to detail.

* [mdns] Comment resolution.

* [mdns] Handle interface name error.

* [restyle]
  • Loading branch information
turon authored and pull[bot] committed May 3, 2022
1 parent 3abc9ae commit 6e3495f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/lib/dnssd/minimal_mdns/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,14 @@ CHIP_ERROR ServerBase::BroadcastImpl(chip::System::PacketBufferHandle && data, u
}
else
{
ChipLogError(Discovery, "Attempt to mDNS broadcast failed: %s", chip::ErrorStr(err));
lastError = err;
#if CHIP_DETAIL_LOGGING
char ifaceName[chip::Inet::InterfaceId::kMaxIfNameLength];
err = info->mInterfaceId.GetInterfaceName(ifaceName, sizeof(ifaceName));
if (err != CHIP_NO_ERROR)
strcpy(ifaceName, "???");
ChipLogDetail(Discovery, "Warning: Attempt to mDNS broadcast failed on %s: %s", ifaceName, lastError.AsString());
#endif
}
return chip::Loop::Continue;
}))
Expand Down

0 comments on commit 6e3495f

Please sign in to comment.