From e9c4253d4713235be834d205fb8564c1c0418e2b Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 3 Feb 2021 17:07:24 +0900 Subject: [PATCH] network: allow to configure nexthop with null address Closes #18446. --- src/network/networkd-nexthop.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/network/networkd-nexthop.c b/src/network/networkd-nexthop.c index a05026db40..fcbb25ba15 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; } -- 2.25.1