Skip to content

Commit

Permalink
Fix logic error: IP address returns a bool not CHIP_ERROR
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Feb 19, 2021
1 parent fba34ab commit 88d1444
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/lib/mdns/minimal/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,15 @@ namespace BroadcastIpAddresses {

void GetIpv6Into(chip::Inet::IPAddress & dest)
{
CHIP_ERROR err = chip::Inet::IPAddress::FromString("FF02::FB", dest);
if (err != CHIP_NO_ERROR)
if (!chip::Inet::IPAddress::FromString("FF02::FB", dest))
{
ChipLogError(Discovery, "Failed to parse standard IPv6 broadcast address");
}
}

void GetIpv4Into(chip::Inet::IPAddress & dest)
{
CHIP_ERROR err = chip::Inet::IPAddress::FromString("224.0.0.251", dest);
if (err != CHIP_NO_ERROR)
if (!chip::Inet::IPAddress::FromString("224.0.0.251", dest))
{
ChipLogError(Discovery, "Failed to parse standard IPv4 broadcast address");
}
Expand Down

0 comments on commit 88d1444

Please sign in to comment.