]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/dhcp4: keep DHCP address and routes on stop even when SendDecline=yes 34994/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 1 Nov 2024 14:47:59 +0000 (23:47 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 4 Nov 2024 17:56:48 +0000 (02:56 +0900)
KeepConfiguration=dhcp or dhcp-on-stop already violate RFC. It is not
necessary to honor the RFC about sending decline message on stop.

src/network/networkd-link.c

index ea68b14a8cefcabea24d03a8e2cfd8741d133644..0e37618a88ee16f13c1d4a2ab94594a7a4f47ddc 100644 (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);