network: fix errno in log_syntax()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 2 Feb 2019 22:08:10 +0000 (23:08 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 10 Feb 2019 16:28:09 +0000 (01:28 +0900)
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
src/network/networkd-network.c

index f594b27..2a45dd9 100644 (file)
@@ -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;
         }
index 12344ec..21fa270 100644 (file)
@@ -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;
         }