From 5bb80a46030902e636c72d850ff9aa97c8632f3f Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 12 Oct 2020 15:12:55 +0900 Subject: [PATCH] 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. --- src/network/networkd-dhcp4.c | 3 +-- src/network/networkd-ndisc.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c index fe8d667c038..29404e34ee5 100644 --- a/src/network/networkd-dhcp4.c +++ b/src/network/networkd-dhcp4.c @@ -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); diff --git a/src/network/networkd-ndisc.c b/src/network/networkd-ndisc.c index 00adbecb891..06c21a2e33a 100644 --- a/src/network/networkd-ndisc.c +++ b/src/network/networkd-ndisc.c @@ -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) -- 2.47.3