]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd: don't try to configure IPv6 proxy NDP if IPv6 is not available (#7613)
authorLennart Poettering <lennart@poettering.net>
Wed, 13 Dec 2017 04:47:10 +0000 (05:47 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 13 Dec 2017 04:47:10 +0000 (13:47 +0900)
Fixes: #7612
src/network/networkd-ipv6-proxy-ndp.c

index 526db69d5beb03e87a26cd4d2cf3e808306ae670..31b7c6b0f4f28f170510bbae92810fc117181e09 100644 (file)
@@ -29,6 +29,7 @@
 #include "networkd-manager.h"
 #include "networkd-network.h"
 #include "string-util.h"
+#include "socket-util.h"
 
 static bool ipv6_proxy_ndp_is_needed(Link *link) {
         assert(link);
@@ -39,7 +40,7 @@ static bool ipv6_proxy_ndp_is_needed(Link *link) {
         if (!link->network)
                 return false;
 
-        if (link->network->ipv6_proxy_ndp != -1)
+        if (link->network->ipv6_proxy_ndp >= 0)
                 return link->network->ipv6_proxy_ndp;
 
         if (link->network->n_ipv6_proxy_ndp_addresses == 0)
@@ -54,6 +55,9 @@ static int ipv6_proxy_ndp_set(Link *link) {
 
         assert(link);
 
+        if (!socket_ipv6_is_supported())
+                return 0;
+
         v = ipv6_proxy_ndp_is_needed(link);
         p = strjoina("/proc/sys/net/ipv6/conf/", link->ifname, "/proxy_ndp");
 
@@ -199,6 +203,8 @@ int ipv6_proxy_ndp_addresses_configure(Link *link) {
         IPv6ProxyNDPAddress *ipv6_proxy_ndp_address;
         int r;
 
+        assert(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)