diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c index 2920e615f3..fe8d667c03 100644 --- a/src/network/networkd-dhcp4.c +++ b/src/network/networkd-dhcp4.c @@ -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) diff --git a/src/network/networkd-ndisc.c b/src/network/networkd-ndisc.c index c67dd7d88e..00adbecb89 100644 --- a/src/network/networkd-ndisc.c +++ b/src/network/networkd-ndisc.c @@ -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) diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index 1ed82d9adc..86404b9dc6 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -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); diff --git a/src/network/networkd-route.h b/src/network/networkd-route.h index 8207b67a2d..71ca876024 100644 --- a/src/network/networkd-route.h +++ b/src/network/networkd-route.h @@ -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;