Skip to content

Commit

Permalink
[mdns] Handle interface name error.
Browse files Browse the repository at this point in the history
  • Loading branch information
turon committed Mar 8, 2022
1 parent cc0659e commit c09ed6a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/lib/dnssd/minimal_mdns/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,13 @@ CHIP_ERROR ServerBase::BroadcastImpl(chip::System::PacketBufferHandle && data, u
}
else
{
char ifaceName[chip::Inet::InterfaceId::kMaxIfNameLength];
info->mInterfaceId.GetInterfaceName(ifaceName, sizeof(ifaceName));
ChipLogDetail(Discovery, "Warning: Attempt to mDNS broadcast failed on %s: %s", ifaceName, err.AsString());
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, "unknown");
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 c09ed6a

Please sign in to comment.