Skip to content
This repository has been archived by the owner on Sep 24, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1 from mischief/networkd-ipforwarding
Browse files Browse the repository at this point in the history
networkd: do not change forwarding if IPForward is not set
  • Loading branch information
mischief committed Mar 27, 2015
2 parents 26f5c59 + 930ab8a commit a2bca81
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/network/networkd-link.c
Expand Up @@ -1357,13 +1357,15 @@ static int link_configure(Link *link) {
if (r < 0)
return r;

r = link_set_ipv4_forward(link);
if (r < 0)
return r;
if (link->network->ip_forward != ADDRESS_FAMILY_UNSET) {
r = link_set_ipv4_forward(link);
if (r < 0)
return r;

r = link_set_ipv6_forward(link);
if (r < 0)
return r;
r = link_set_ipv6_forward(link);
if (r < 0)
return r;
}

if (link_ipv4ll_enabled(link)) {
r = ipv4ll_configure(link);
Expand Down
2 changes: 2 additions & 0 deletions src/network/networkd-network.c
Expand Up @@ -109,6 +109,8 @@ static int network_load_one(Manager *manager, const char *filename) {

network->link_local = ADDRESS_FAMILY_IPV6;

network->ip_forward = ADDRESS_FAMILY_UNSET;

r = config_parse(NULL, filename, file,
"Match\0"
"Link\0"
Expand Down
1 change: 1 addition & 0 deletions src/network/networkd.h
Expand Up @@ -60,6 +60,7 @@ typedef enum AddressFamilyBoolean {
ADDRESS_FAMILY_IPV4 = 1,
ADDRESS_FAMILY_IPV6 = 2,
ADDRESS_FAMILY_YES = 3,
ADDRESS_FAMILY_UNSET = 4,
_ADDRESS_FAMILY_BOOLEAN_MAX,
_ADDRESS_FAMILY_BOOLEAN_INVALID = -1,
} AddressFamilyBoolean;
Expand Down

0 comments on commit a2bca81

Please sign in to comment.