From: Yu Watanabe Date: Wed, 3 Feb 2021 08:07:24 +0000 (+0900) Subject: network: allow to configure nexthop with null address X-Git-Tag: v248-rc1~82^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9c4253d4713235be834d205fb8564c1c0418e2b;p=thirdparty%2Fsystemd.git network: allow to configure nexthop with null address Closes #18446. --- diff --git a/src/network/networkd-nexthop.c b/src/network/networkd-nexthop.c index a05026db406..fcbb25ba158 100644 --- a/src/network/networkd-nexthop.c +++ b/src/network/networkd-nexthop.c @@ -440,8 +440,9 @@ static int nexthop_section_verify(NextHop *nh) { if (section_is_invalid(nh->section)) return -EINVAL; - if (in_addr_is_null(nh->family, &nh->gw) < 0) - return -EINVAL; + if (nh->family == AF_UNSPEC) + /* When no Gateway= is specified, assume IPv4. */ + nh->family = AF_INET; return 0; }