]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: make Gateway= in [Route] section accept an empty string
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 7 Oct 2020 11:39:47 +0000 (13:39 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 7 Oct 2020 17:51:23 +0000 (02:51 +0900)
src/network/networkd-route.c

index 12a344049f0ecf9f3483ee663dee5153d69da64d..b59c48d48238d7afcf2675e165aa2695d0f7eeee 100644 (file)
@@ -1720,6 +1720,14 @@ int config_parse_gateway(
                         return 0;
                 }
 
+                if (isempty(rvalue)) {
+                        n->gateway_from_dhcp = false;
+                        n->gw_family = AF_UNSPEC;
+                        n->gw = IN_ADDR_NULL;
+                        TAKE_PTR(n);
+                        return 0;
+                }
+
                 if (streq(rvalue, "_dhcp")) {
                         n->gateway_from_dhcp = true;
                         TAKE_PTR(n);