From 9640cdaace86da5d6f197016a4c9b8241e23a807 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Wed, 18 Jan 2012 15:24:56 +0200 Subject: dhcpv6: Do not wait answer to RELEASE message We do not want to wait the answer to release message that was sent to the DHCPv6 server because the reply from server might take some time and we must continue the network disconnect procedure. So we just inform the server that we are done with the addresses but ignore server reply as there is nothing to be done anyway after sending the release. --- src/dhcpv6.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'src/dhcpv6.c') diff --git a/src/dhcpv6.c b/src/dhcpv6.c index f2c7da60..fe2f0fa0 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -859,18 +859,6 @@ int __connman_dhcpv6_start_renew(struct connman_network *network, return 0; } -static void release_cb(GDHCPClient *dhcp_client, gpointer user_data) -{ - struct connman_dhcpv6 *dhcp = user_data; - - DBG("dhcpv6 release msg %p", dhcp); - - if (dhcp->callback != NULL) { - uint16_t status = g_dhcpv6_client_get_status(dhcp_client); - dhcp->callback(dhcp->network, status == 0 ? TRUE : FALSE); - } -} - int __connman_dhcpv6_start_release(struct connman_network *network, dhcp_cb callback) { @@ -909,8 +897,13 @@ int __connman_dhcpv6_start_release(struct connman_network *network, clear_callbacks(dhcp_client); - g_dhcp_client_register_event(dhcp_client, G_DHCP_CLIENT_EVENT_RELEASE, - release_cb, dhcp); + /* + * We do not register callback here because the answer might take too + * long time and network code might be in the middle of the disconnect. + * So we just inform the server that we are done with the addresses + * but ignore the reply from server. This is allowed by RFC 3315 + * chapter 18.1.6. + */ dhcp->dhcp_client = dhcp_client; -- cgit v1.2.3