]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: allow to configure nexthop with null address
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 3 Feb 2021 08:07:24 +0000 (17:07 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 17 Feb 2021 06:55:37 +0000 (15:55 +0900)
Closes #18446.

src/network/networkd-nexthop.c

index a05026db4066d3488afe77cf1d0b3c1cb055f746..fcbb25ba158147881297ed8740ab10010edc36db 100644 (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;
 }