]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: rename gateway_from_dhcp -> gateway_from_dhcp_or_ra
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 12 Oct 2020 05:44:04 +0000 (14:44 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 14 Oct 2020 21:58:53 +0000 (06:58 +0900)
As for IPv6 case gateway is given by RA.

src/network/networkd-dhcp4.c
src/network/networkd-ndisc.c
src/network/networkd-route.c
src/network/networkd-route.h

index 2920e615f3c4a024554c86eeac882dbfd98c179b..fe8d667c0384e07231a62704c3914bd3c22925fe 100644 (file)
@@ -388,7 +388,7 @@ static int link_set_dhcp_routes(Link *link) {
                                 return log_link_error_errno(link, r, "Could not set router: %m");
 
                         HASHMAP_FOREACH(rt, link->network->routes_by_section) {
-                                if (!rt->gateway_from_dhcp)
+                                if (!rt->gateway_from_dhcp_or_ra)
                                         continue;
 
                                 if (rt->family != AF_INET)
index c67dd7d88ed5ad012b9bc108c64c49d65d87801e..00adbecb891f1110d10be551db18bf53e799e7b3 100644 (file)
@@ -524,7 +524,7 @@ static int ndisc_router_process_default(Link *link, sd_ndisc_router *rt) {
 
         Route *route_gw;
         HASHMAP_FOREACH(route_gw, link->network->routes_by_section) {
-                if (!route_gw->gateway_from_dhcp)
+                if (!route_gw->gateway_from_dhcp_or_ra)
                         continue;
 
                 if (route_gw->family != AF_INET6)
index 1ed82d9adce0f62ba30e52e96fa1e56aba04ea31..86404b9dc64a75a99ed4dc73a62fd5a8fdad47de 100644 (file)
@@ -1192,7 +1192,7 @@ int link_set_routes(Link *link) {
         /* First add the routes that enable us to talk to gateways, then add in the others that need a gateway. */
         for (phase = 0; phase < _PHASE_MAX; phase++)
                 HASHMAP_FOREACH(rt, link->network->routes_by_section) {
-                        if (rt->gateway_from_dhcp)
+                        if (rt->gateway_from_dhcp_or_ra)
                                 continue;
 
                         if ((in_addr_is_null(rt->gw_family, &rt->gw) && ordered_set_isempty(rt->multipath_routes)) != (phase == PHASE_NON_GATEWAY))
@@ -1723,7 +1723,7 @@ int config_parse_gateway(
                 }
 
                 if (isempty(rvalue)) {
-                        n->gateway_from_dhcp = false;
+                        n->gateway_from_dhcp_or_ra = false;
                         n->gw_family = AF_UNSPEC;
                         n->gw = IN_ADDR_NULL;
                         TAKE_PTR(n);
@@ -1731,21 +1731,21 @@ int config_parse_gateway(
                 }
 
                 if (streq(rvalue, "_dhcp")) {
-                        n->gateway_from_dhcp = true;
+                        n->gateway_from_dhcp_or_ra = true;
                         TAKE_PTR(n);
                         return 0;
                 }
 
                 if (streq(rvalue, "_dhcp4")) {
                         n->gw_family = AF_INET;
-                        n->gateway_from_dhcp = true;
+                        n->gateway_from_dhcp_or_ra = true;
                         TAKE_PTR(n);
                         return 0;
                 }
 
                 if (streq(rvalue, "_dhcp6")) {
                         n->gw_family = AF_INET6;
-                        n->gateway_from_dhcp = true;
+                        n->gateway_from_dhcp_or_ra = true;
                         TAKE_PTR(n);
                         return 0;
                 }
@@ -1758,7 +1758,7 @@ int config_parse_gateway(
                 return 0;
         }
 
-        n->gateway_from_dhcp = false;
+        n->gateway_from_dhcp_or_ra = false;
         TAKE_PTR(n);
         return 0;
 }
@@ -2386,7 +2386,7 @@ static int route_section_verify(Route *route, Network *network) {
         if (route->family == AF_UNSPEC) {
                 assert(route->section);
 
-                if (route->gateway_from_dhcp) {
+                if (route->gateway_from_dhcp_or_ra) {
                         log_warning("%s: Deprecated value \"_dhcp\" is specified for Gateway= in [Route] section from line %u. "
                                     "Please use \"_dhcp4\" or \"_dhcp6\" instead. Assuming \"_dhcp4\".",
                                     route->section->filename, route->section->line);
index 8207b67a2df594f07c79ab9b23494c41614ef283..71ca87602437ab3209bca1470ba681d7c000759a 100644 (file)
@@ -45,7 +45,7 @@ typedef struct Route {
         unsigned char pref;
         unsigned flags;
         int gateway_onlink;
-        bool gateway_from_dhcp;
+        bool gateway_from_dhcp_or_ra;
 
         union in_addr_union gw;
         union in_addr_union dst;