mirror of
https://github.com/systemd/systemd.git
synced 2025-03-22 06:50:18 +03:00
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
This commit is contained in:
parent
5c82dd13e1
commit
fe0272999c
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user