1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-31 16:21:26 +03:00

network: nexthop: unset gateway when an empty string is assigned

This commit is contained in:
Yu Watanabe 2021-02-03 16:58:29 +09:00
parent 68337e55f6
commit 0008b5aee2

View File

@ -519,6 +519,14 @@ int config_parse_nexthop_gateway(
if (r < 0)
return log_oom();
if (isempty(rvalue)) {
n->family = AF_UNSPEC;
n->gw = IN_ADDR_NULL;
TAKE_PTR(n);
return 0;
}
r = in_addr_from_string_auto(rvalue, &n->family, &n->gw);
if (r < 0) {
log_syntax(unit, LOG_WARNING, filename, line, r,