network: allow to configure nexthop with null address

Closes #18446.
This commit is contained in:
Yu Watanabe
2021-02-03 17:07:24 +09:00
parent 0008b5aee2
commit e9c4253d47

View File

@@ -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;
}