From 88d1444a11b9a2322666e8edc5c457354ce24c78 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 19 Feb 2021 17:08:44 -0500 Subject: [PATCH] Fix logic error: IP address returns a bool not CHIP_ERROR --- src/lib/mdns/minimal/Server.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib/mdns/minimal/Server.cpp b/src/lib/mdns/minimal/Server.cpp index f8828b170dcc94..00b8905988ee42 100644 --- a/src/lib/mdns/minimal/Server.cpp +++ b/src/lib/mdns/minimal/Server.cpp @@ -56,8 +56,7 @@ 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"); } @@ -65,8 +64,7 @@ void GetIpv6Into(chip::Inet::IPAddress & dest) 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"); }