From c606db69ab5d872c79046aa1632e38be6ac6d1db Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 2 Feb 2019 23:08:10 +0100 Subject: [PATCH] network: fix errno in log_syntax() in_addr_is_null() returns boolean if the first argument is valid. So, passing the return value to log_syntax() as errno is wrong. --- src/network/networkd-ipv6-proxy-ndp.c | 5 ++--- src/network/networkd-network.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/network/networkd-ipv6-proxy-ndp.c b/src/network/networkd-ipv6-proxy-ndp.c index f594b27f7f0..2a45dd94895 100644 --- a/src/network/networkd-ipv6-proxy-ndp.c +++ b/src/network/networkd-ipv6-proxy-ndp.c @@ -122,9 +122,8 @@ int config_parse_ipv6_proxy_ndp_address( return 0; } - r = in_addr_is_null(AF_INET6, &buffer); - if (r != 0) { - log_syntax(unit, LOG_ERR, filename, line, r, + if (in_addr_is_null(AF_INET6, &buffer)) { + log_syntax(unit, LOG_ERR, filename, line, 0, "IPv6 proxy NDP address cannot be the ANY address, ignoring: %s", rvalue); return 0; } diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index 12344ec695b..21fa2706311 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -857,9 +857,8 @@ int config_parse_ipv6token( return 0; } - r = in_addr_is_null(AF_INET6, &buffer); - if (r != 0) { - log_syntax(unit, LOG_ERR, filename, line, r, "IPv6 token cannot be the ANY address, ignoring: %s", rvalue); + if (in_addr_is_null(AF_INET6, &buffer)) { + log_syntax(unit, LOG_ERR, filename, line, 0, "IPv6 token cannot be the ANY address, ignoring: %s", rvalue); return 0; } -- 2.47.3