]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: determine a [Route] section will be used or not by gateway family instead...
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 12 Oct 2020 06:12:55 +0000 (15:12 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 14 Oct 2020 22:06:03 +0000 (07:06 +0900)
By this commit, user can configure dynamic IPv6 Gateway with IPv4
destination.

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

index fe8d667c0384e07231a62704c3914bd3c22925fe..29404e34ee5ec7ad9968d9817358061d0e398002 100644 (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);
index 00adbecb891f1110d10be551db18bf53e799e7b3..06c21a2e33a0a145028212117d7e77734ce4ddf4 100644 (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)