From: Lennart Poettering Date: Wed, 13 Dec 2017 04:47:10 +0000 (+0100) Subject: networkd: don't try to configure IPv6 proxy NDP if IPv6 is not available (#7613) X-Git-Tag: v236~20 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=18a121f9b462e2241c4a590f0a47f5351cd47e0f;p=thirdparty%2Fsystemd.git networkd: don't try to configure IPv6 proxy NDP if IPv6 is not available (#7613) Fixes: #7612 --- diff --git a/src/network/networkd-ipv6-proxy-ndp.c b/src/network/networkd-ipv6-proxy-ndp.c index 526db69d5be..31b7c6b0f4f 100644 --- a/src/network/networkd-ipv6-proxy-ndp.c +++ b/src/network/networkd-ipv6-proxy-ndp.c @@ -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)