If the callback stops and removes the DHCP transaction, the dhcp
structure is no longer valid when returning from the callback. Fix
this by restarting the DHCP transaction before calling the callback.
---
 gdhcp/client.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdhcp/client.c b/gdhcp/client.c
index a115a68..98710d2 100644
--- a/gdhcp/client.c
+++ b/gdhcp/client.c
@@ -1643,13 +1643,13 @@ static gboolean start_expire(gpointer user_data)
        /*remove all timeouts if they are set*/
        remove_timeouts(dhcp_client);
 
+       restart_dhcp(dhcp_client, 0);
+
        /* ip need to be cleared */
        if (dhcp_client->lease_lost_cb)
                dhcp_client->lease_lost_cb(dhcp_client,
                                dhcp_client->lease_lost_data);
 
-       restart_dhcp(dhcp_client, 0);
-
        return false;
 }
 
-- 
1.8.5.3

_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to