network/route-nexthop: configure as a simple gateway when MultipathRoute= is specified only once
The kernel handles such configuration completely equivalent to the case that Gateway= is specified.
This commit is contained in:
@@ -873,6 +873,16 @@ int route_section_verify_nexthops(Route *route) {
|
||||
"Ignoring [Route] section from line %u.",
|
||||
route->section->filename, route->section->line);
|
||||
|
||||
if (ordered_set_size(route->nexthops) == 1) {
|
||||
_cleanup_(route_nexthop_freep) RouteNextHop *nh = ordered_set_steal_first(route->nexthops);
|
||||
|
||||
route_nexthop_done(&route->nexthop);
|
||||
route->nexthop = TAKE_STRUCT(*nh);
|
||||
|
||||
assert(ordered_set_isempty(route->nexthops));
|
||||
route->nexthops = ordered_set_free(route->nexthops);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user