From: Yu Watanabe Date: Wed, 3 Feb 2021 07:58:29 +0000 (+0900) Subject: network: nexthop: unset gateway when an empty string is assigned X-Git-Tag: v248-rc1~82^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0008b5aee22e32c60f2df5ce925ddf7e25f83bd8;p=thirdparty%2Fsystemd.git network: nexthop: unset gateway when an empty string is assigned --- diff --git a/src/network/networkd-nexthop.c b/src/network/networkd-nexthop.c index 6143de11f3b..a05026db406 100644 --- a/src/network/networkd-nexthop.c +++ b/src/network/networkd-nexthop.c @@ -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,