]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: propagate errors in ipv6_proxy_ndp_set()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 29 Sep 2020 20:24:03 +0000 (05:24 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 6 Oct 2020 17:44:42 +0000 (02:44 +0900)
And ignore IPv6ProxyNDPAddress= settings if proxy_ndp is zero.

src/network/networkd-ipv6-proxy-ndp.c

index f0870becac854d7827bacf0f5376c9f1c3ea0f00..fb8464ff2fa7cdeeb3769700f73396fb98d46d10 100644 (file)
@@ -84,9 +84,9 @@ static int ipv6_proxy_ndp_set(Link *link) {
 
         r = sysctl_write_ip_property_boolean(AF_INET6, link->ifname, "proxy_ndp", v);
         if (r < 0)
-                log_link_warning_errno(link, r, "Cannot configure proxy NDP for interface: %m");
+                return log_link_warning_errno(link, r, "Cannot configure proxy NDP for the interface: %m");
 
-        return 0;
+        return v;
 }
 
 /* configure all ipv6 proxy ndp addresses */
@@ -99,7 +99,7 @@ int link_set_ipv6_proxy_ndp_addresses(Link *link) {
 
         /* enable or disable proxy_ndp itself depending on whether ipv6_proxy_ndp_addresses are set or not */
         r = ipv6_proxy_ndp_set(link);
-        if (r < 0)
+        if (r <= 0)
                 return r;
 
         SET_FOREACH(address, link->network->ipv6_proxy_ndp_addresses) {