network: determine a [Route] section will be used or not by gateway family instead of route family

By this commit, user can configure dynamic IPv6 Gateway with IPv4
destination.
This commit is contained in:
Yu Watanabe 2020-10-12 15:12:55 +09:00
parent c3d679c43f
commit 5bb80a4603
2 changed files with 2 additions and 4 deletions

View File

@ -391,10 +391,9 @@ static int link_set_dhcp_routes(Link *link) {
if (!rt->gateway_from_dhcp_or_ra)
continue;
if (rt->family != AF_INET)
if (rt->gw_family != AF_INET)
continue;
rt->gw_family = AF_INET;
rt->gw.in = router[0];
r = dhcp_route_configure(rt, link);

View File

@ -527,11 +527,10 @@ static int ndisc_router_process_default(Link *link, sd_ndisc_router *rt) {
if (!route_gw->gateway_from_dhcp_or_ra)
continue;
if (route_gw->family != AF_INET6)
if (route_gw->gw_family != AF_INET6)
continue;
route_gw->gw = gateway;
route_gw->gw_family = AF_INET6;
r = ndisc_route_configure(route_gw, link, rt);
if (r < 0)