diff options
Diffstat (limited to 'src/network/networkd-network.c')
-rw-r--r-- | src/network/networkd-network.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index 6f32e5f4a4..ec95c8661e 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -717,3 +717,37 @@ int config_parse_ipv6token( return 0; } + +int config_parse_address_family_boolean_with_kernel( + const char* unit, + const char *filename, + unsigned line, + const char *section, + unsigned section_line, + const char *lvalue, + int ltype, + const char *rvalue, + void *data, + void *userdata) { + + AddressFamilyBoolean *fwd = data, s; + + assert(filename); + assert(lvalue); + assert(rvalue); + assert(data); + + s = address_family_boolean_from_string(rvalue); + if (s < 0) { + if (streq(rvalue, "kernel")) + s = _ADDRESS_FAMILY_BOOLEAN_INVALID; + else { + log_syntax(unit, LOG_ERR, filename, line, s, "Failed to parse IPForwarding option, ignoring: %s", rvalue); + return 0; + } + } + + *fwd = s; + + return 0; +} |