]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-dhcp-client: add FIXME comment about the state callback 41796/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 15 Apr 2026 19:07:25 +0000 (04:07 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 23 Apr 2026 22:40:08 +0000 (07:40 +0900)
At least currently, it is a theoretical concern, as networkd does not
change the client state in the callback.

src/libsystemd-network/sd-dhcp-client.c

index ad7714d596d09103937d3a824da4087cd44f444b..9742ab833bd5beeca547a3c7e0eb408862efbab3 100644 (file)
@@ -629,6 +629,8 @@ static void client_set_state(sd_dhcp_client *client, DHCPState state) {
                 ;
         }
 
+        // FIXME: If the state callback changes the state, we may not safely free/stop the client, and the
+        // state machine diagram becomes needlessly complicated. Introduce a guard to avoid that. */
         if (client->state_callback)
                 client->state_callback(client, state, client->state_userdata);
 }