diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-06-12 12:28:16 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-06-12 12:28:16 +0200 |
commit | 533b4329404ef34081bf0cb4fcdef2aeda4a8820 (patch) | |
tree | 18e84bfda8b412845727d5b66779df5d31fb94d1 /src/network/networkd-link.c | |
parent | 4ff7d7e90ccc47e1e7e1f99bbeaae669d04ce782 (diff) | |
parent | 2972cba11712c3bfbe9fa07d1f3c3c4330127733 (diff) |
Merge pull request #173 from mischief/ipforwarding-3
IPForwarding=kernel v3
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r-- | src/network/networkd-link.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 7841f69dab..b1947886b7 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -1477,6 +1477,9 @@ static int link_set_ipv4_forward(Link *link) { const char *p = NULL; int r; + if (link->network->ip_forward == _ADDRESS_FAMILY_BOOLEAN_INVALID) + return 0; + p = strjoina("/proc/sys/net/ipv4/conf/", link->ifname, "/forwarding"); r = write_string_file_no_create(p, one_zero(link_ipv4_forward_enabled(link))); if (r < 0) @@ -1493,6 +1496,9 @@ static int link_set_ipv6_forward(Link *link) { if (!socket_ipv6_is_supported()) return 0; + if (link->network->ip_forward == _ADDRESS_FAMILY_BOOLEAN_INVALID) + 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) |