Skip to content

Commit e9c4253

Browse files
committed
network: allow to configure nexthop with null address
Closes systemd#18446.
1 parent 0008b5a commit e9c4253

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/network/networkd-nexthop.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,9 @@ static int nexthop_section_verify(NextHop *nh) {
440440
if (section_is_invalid(nh->section))
441441
return -EINVAL;
442442

443-
if (in_addr_is_null(nh->family, &nh->gw) < 0)
444-
return -EINVAL;
443+
if (nh->family == AF_UNSPEC)
444+
/* When no Gateway= is specified, assume IPv4. */
445+
nh->family = AF_INET;
445446

446447
return 0;
447448
}

0 commit comments

Comments
 (0)