Skip to content

Commit

Permalink
networkd: don't try to turn on ipv6 forwarding if kernel lacks IPv6 s…
Browse files Browse the repository at this point in the history
  • Loading branch information
poettering committed May 15, 2015
1 parent 5c82dd1 commit fe02729
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/network/networkd-link.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit fe02729

Please sign in to comment.