summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-ipv6-proxy-ndp.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-12-13 05:47:10 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2017-12-13 05:47:10 +0100
commit18a121f9b462e2241c4a590f0a47f5351cd47e0f (patch)
tree1f13b44957465c219a3ad7f28278c1d379db7725 /src/network/networkd-ipv6-proxy-ndp.c
parentMerge pull request #7588 from poettering/resolve-route-tweak (diff)
downloadsystemd-18a121f9b462e2241c4a590f0a47f5351cd47e0f.tar.xz
systemd-18a121f9b462e2241c4a590f0a47f5351cd47e0f.zip
networkd: don't try to configure IPv6 proxy NDP if IPv6 is not available (#7613)
Fixes: #7612
Diffstat (limited to 'src/network/networkd-ipv6-proxy-ndp.c')
-rw-r--r--src/network/networkd-ipv6-proxy-ndp.c8
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)