Skip to content

Commit 1209331

Browse files
turonpull[bot]
authored andcommitted
[mdns] Show interface on mDns failures. (#15266)
* [mdns] Show interface on mDns failures. * [log] Deescalate bad interface log from error to detail. * [mdns] Comment resolution. * [mdns] Handle interface name error. * [restyle]
1 parent 1357d2e commit 1209331

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/lib/dnssd/minimal_mdns/Server.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,14 @@ CHIP_ERROR ServerBase::BroadcastImpl(chip::System::PacketBufferHandle && data, u
386386
}
387387
else
388388
{
389-
ChipLogError(Discovery, "Attempt to mDNS broadcast failed: %s", chip::ErrorStr(err));
390389
lastError = err;
390+
#if CHIP_DETAIL_LOGGING
391+
char ifaceName[chip::Inet::InterfaceId::kMaxIfNameLength];
392+
err = info->mInterfaceId.GetInterfaceName(ifaceName, sizeof(ifaceName));
393+
if (err != CHIP_NO_ERROR)
394+
strcpy(ifaceName, "???");
395+
ChipLogDetail(Discovery, "Warning: Attempt to mDNS broadcast failed on %s: %s", ifaceName, lastError.AsString());
396+
#endif
391397
}
392398
return chip::Loop::Continue;
393399
}))

0 commit comments

Comments
 (0)