diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-01-09 04:20:41 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-01-12 01:44:03 +0100 |
commit | 4207f6c05d0fe41422ae7294081af79fe43a5992 (patch) | |
tree | 37ef9dc1ff80bd65d11293df52ff08fce09a1cce /src/network/networkd-route-nexthop.c | |
parent | network/route: move two more conf parsers to networkd-route-nexthop.[ch] (diff) | |
download | systemd-4207f6c05d0fe41422ae7294081af79fe43a5992.tar.xz systemd-4207f6c05d0fe41422ae7294081af79fe43a5992.zip |
network/route-nexthop: make GatewayOnLink= support an empty string
And invalidate the route section if an invalid string is specified.
Diffstat (limited to '')
-rw-r--r-- | src/network/networkd-route-nexthop.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/network/networkd-route-nexthop.c b/src/network/networkd-route-nexthop.c index 3b1da1801f..c1b191b3ef 100644 --- a/src/network/networkd-route-nexthop.c +++ b/src/network/networkd-route-nexthop.c @@ -124,14 +124,10 @@ int config_parse_route_gateway_onlink( return 0; } - r = parse_boolean(rvalue); - if (r < 0) { - log_syntax(unit, LOG_WARNING, filename, line, r, - "Could not parse %s=\"%s\", ignoring assignment: %m", lvalue, rvalue); - return 0; - } - - route->gateway_onlink = r; + r = config_parse_tristate(unit, filename, line, section, section_line, lvalue, ltype, rvalue, + &route->gateway_onlink, network); + if (r <= 0) + return r; TAKE_PTR(route); return 0; |