diff options
-rw-r--r-- | src/network/networkd-ipv6-proxy-ndp.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/network/networkd-ipv6-proxy-ndp.c b/src/network/networkd-ipv6-proxy-ndp.c index 526db69d5b..31b7c6b0f4 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) |