Skip to content

Commit

Permalink
dhcp: Stop IPv4 ll state machine properly
Browse files Browse the repository at this point in the history
Now the IPv4 ll address is set correctly if the ll state machine
is run more than once. The real culprit was that the ipv4ll_running
flag was not cleared when dhcp_release() was called.

Reported-by: Tim Sander <tim@krieglstein.org>
  • Loading branch information
jukkar authored and pfl committed Nov 14, 2013
1 parent a710cd3 commit 32c1abe
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/dhcp.c
Expand Up @@ -565,24 +565,18 @@ static int dhcp_release(struct connman_dhcp *dhcp)
if (dhcp->timeout > 0)
g_source_remove(dhcp->timeout);

if (dhcp->ipv4ll_client) {
g_dhcp_client_stop(dhcp->ipv4ll_client);
g_dhcp_client_unref(dhcp->ipv4ll_client);
}

if (dhcp->dhcp_client) {
g_dhcp_client_stop(dhcp->dhcp_client);
g_dhcp_client_unref(dhcp->dhcp_client);
}

dhcp->ipv4ll_client = NULL;
dhcp->dhcp_client = NULL;

g_free(dhcp->ipv4ll_debug_prefix);
g_free(dhcp->dhcp_debug_prefix);
dhcp->ipv4ll_debug_prefix = NULL;
dhcp->dhcp_debug_prefix = NULL;

ipv4ll_stop_client(dhcp);

return 0;
}

Expand Down

0 comments on commit 32c1abe

Please sign in to comment.