summaryrefslogtreecommitdiff
path: root/src/network/networkd-link.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-05-15 12:20:36 +0200
committerLennart Poettering <lennart@poettering.net>2015-05-15 12:20:36 +0200
commitfe0272999c8ef7961a446a7743f824ba4cfe0918 (patch)
treedc7f05cdfd547610114ee0711752d043a6ee9081 /src/network/networkd-link.c
parent5c82dd13e1eef502afcef209a3b14a2100966909 (diff)
networkd: don't try to turn on ipv6 forwarding if kernel lacks IPv6 support
http://lists.freedesktop.org/archives/systemd-devel/2015-May/031598.html
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r--src/network/networkd-link.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 1c59e150d5..8b0de1f741 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -26,6 +26,7 @@
#include "util.h"
#include "virt.h"
#include "fileio.h"
+#include "socket-util.h"
#include "bus-util.h"
#include "udev-util.h"
#include "network-internal.h"
@@ -1489,6 +1490,10 @@ static int link_set_ipv6_forward(Link *link) {
const char *p = NULL;
int r;
+ /* Make this a NOP if IPv6 is not available */
+ if (!socket_ipv6_is_supported())
+ return 0;
+
p = strjoina("/proc/sys/net/ipv6/conf/", link->ifname, "/forwarding");
r = write_string_file_no_create(p, one_zero(link_ipv6_forward_enabled(link)));
if (r < 0)