1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-26 03:22:00 +03:00

network/dhcp4: keep DHCP address and routes on stop even when SendDecline=yes

KeepConfiguration=dhcp or dhcp-on-stop already violate RFC. It is not
necessary to honor the RFC about sending decline message on stop.
This commit is contained in:
Yu Watanabe 2024-11-01 23:47:59 +09:00
parent 2afd12e0a1
commit 8c3d6d7150

View File

@ -376,11 +376,11 @@ int link_stop_engines(Link *link, bool may_keep_dhcp) {
assert(link->manager);
assert(link->manager->event);
bool keep_dhcp = may_keep_dhcp &&
link->network &&
!link->network->dhcp_send_decline && /* IPv4 ACD for the DHCPv4 address is running. */
(link->manager->state == MANAGER_RESTARTING ||
FLAGS_SET(link->network->keep_configuration, KEEP_CONFIGURATION_DHCP_ON_STOP));
bool keep_dhcp =
may_keep_dhcp &&
link->network &&
(link->manager->state == MANAGER_RESTARTING ||
FLAGS_SET(link->network->keep_configuration, KEEP_CONFIGURATION_DHCP_ON_STOP));
if (!keep_dhcp) {
r = sd_dhcp_client_stop(link->dhcp_client);