]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/ipv4acd: adjust comment and logging 34054/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 21 Aug 2024 01:47:09 +0000 (10:47 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 21 Aug 2024 02:45:57 +0000 (11:45 +0900)
src/network/networkd-ipv4acd.c

index 6b1abc42e8d3d0ca74a7499d7b57329e09e79137..4785b96f9f32f3da879dfc9e52a5edbff9ac0de5 100644 (file)
@@ -111,20 +111,20 @@ static int dhcp4_address_on_conflict(Link *link) {
         assert(link);
         assert(link->dhcp_client);
 
+        log_link_warning(link, "Dropping DHCPv4 lease, as an address conflict was detected.");
+
         r = sd_dhcp_client_send_decline(link->dhcp_client);
         if (r < 0)
                 log_link_warning_errno(link, r, "Failed to send DHCP DECLINE, ignoring: %m");
 
         if (!link->dhcp_lease)
-                /* Unlikely, but during probing the address, the lease may be lost. */
                 return 0;
 
-        log_link_warning(link, "Dropping DHCPv4 lease, as an address conflict was detected.");
         r = dhcp4_lease_lost(link);
         if (r < 0)
                 return log_link_warning_errno(link, r, "Failed to drop DHCPv4 lease: %m");
 
-        /* It is not necessary to call address_remove() here, as dhcp4_lease_lost() removes it. */
+        /* It is not necessary to call address_remove() here, as dhcp4_lease_lost() removes the address. */
         return 0;
 }