mirror of
https://github.com/systemd/systemd.git
synced 2024-12-23 21:35:11 +03:00
network: do not configure routes when dropping addresses
Follow-up for 4ff296b024
.
This commit is contained in:
parent
a483dc92c2
commit
4e2ef9d9d1
@ -103,6 +103,11 @@ static int link_set_dhcp_routes(Link *link) {
|
||||
if (!link->network->dhcp_use_routes)
|
||||
return 0;
|
||||
|
||||
if (!link_has_carrier(link) && !link->network->configure_without_carrier)
|
||||
/* During configuring addresses, the link lost its carrier. As networkd is dropping
|
||||
* the addresses now, let's not configure the routes either. */
|
||||
return 0;
|
||||
|
||||
table = link_get_dhcp_route_table(link);
|
||||
|
||||
r = sd_dhcp_lease_get_address(link->dhcp_lease, &address);
|
||||
|
@ -934,6 +934,11 @@ int link_request_set_routes(Link *link) {
|
||||
|
||||
link->static_routes_configured = false;
|
||||
|
||||
if (!link_has_carrier(link) && !link->network->configure_without_carrier)
|
||||
/* During configuring addresses, the link lost its carrier. As networkd is dropping
|
||||
* the addresses now, let's not configure the routes either. */
|
||||
return 0;
|
||||
|
||||
r = link_request_set_routing_policy_rule(link);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
Loading…
Reference in New Issue
Block a user