]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: do not re-assign static routes when dynamic IPv6 addresses are updated
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 20 Jan 2021 07:17:33 +0000 (16:17 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 22 Jan 2021 03:53:18 +0000 (12:53 +0900)
This effectively reverts 6545067aa950cf0af740a6fad88ff56d1b3fd40a.

Unlike IPv4 addresses, routes are not removed when IPv6 addresses are
removed. So, it is not necessary to re-assign routes.

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

index d9b45a8a1458a0382bbc99920127afca20b50651..56c5599d191fb44f6aebc57c3188d8212bb57043 100644 (file)
@@ -352,12 +352,6 @@ static int dhcp6_pd_address_handler(sd_netlink *rtnl, sd_netlink_message *m, Lin
                         link_enter_failed(link);
                         return 1;
                 }
-
-                r = link_set_routes(link);
-                if (r < 0) {
-                        link_enter_failed(link);
-                        return 1;
-                }
         }
 
         return 1;
@@ -618,14 +612,8 @@ static int dhcp6_pd_finalize(Link *link) {
         if (link->dhcp6_pd_address_messages == 0) {
                 if (link->dhcp6_pd_prefixes_assigned)
                         link->dhcp6_pd_address_configured = true;
-        } else {
+        } else
                 log_link_debug(link, "Setting DHCPv6 PD addresses");
-                /* address_handler calls link_set_routes() and link_set_nexthop(). Before they are
-                 * called, the related flags must be cleared. Otherwise, the link becomes configured
-                 * state before routes are configured. */
-                link->static_routes_configured = false;
-                link->static_nexthops_configured = false;
-        }
 
         if (link->dhcp6_pd_route_messages == 0) {
                 if (link->dhcp6_pd_prefixes_assigned)
@@ -962,12 +950,6 @@ static int dhcp6_address_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *
                         link_enter_failed(link);
                         return 1;
                 }
-
-                r = link_set_routes(link);
-                if (r < 0) {
-                        link_enter_failed(link);
-                        return 1;
-                }
         }
 
         return 1;
@@ -1149,14 +1131,8 @@ static int dhcp6_lease_ip_acquired(sd_dhcp6_client *client, Link *link) {
 
         if (link->dhcp6_address_messages == 0)
                 link->dhcp6_address_configured = true;
-        else {
+        else
                 log_link_debug(link, "Setting DHCPv6 addresses");
-                /* address_handler calls link_set_routes() and link_set_nexthop(). Before they are
-                 * called, the related flags must be cleared. Otherwise, the link becomes configured
-                 * state before routes are configured. */
-                link->static_routes_configured = false;
-                link->static_nexthops_configured = false;
-        }
 
         if (link->dhcp6_route_messages == 0)
                 link->dhcp6_route_configured = true;
index 82de316bc3af8e068c98855b32597f925adf2dce..f04d7a6e44ff8e9ee3ccf2706b5979ddf514a4be 100644 (file)
@@ -412,12 +412,6 @@ static int ndisc_address_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *
                         link_enter_failed(link);
                         return 1;
                 }
-
-                r = link_set_routes(link);
-                if (r < 0) {
-                        link_enter_failed(link);
-                        return 1;
-                }
         }
 
         return 1;
@@ -1244,16 +1238,9 @@ static int ndisc_router_handler(Link *link, sd_ndisc_router *rt) {
 
         if (link->ndisc_addresses_messages == 0)
                 link->ndisc_addresses_configured = true;
-        else {
+        else
                 log_link_debug(link, "Setting SLAAC addresses.");
 
-                /* address_handler calls link_set_routes() and link_set_nexthop(). Before they are
-                 * called, the related flags must be cleared. Otherwise, the link becomes configured
-                 * state before routes are configured. */
-                link->static_routes_configured = false;
-                link->static_nexthops_configured = false;
-        }
-
         if (link->ndisc_routes_messages == 0)
                 link->ndisc_routes_configured = true;
         else