diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2012-01-18 15:24:56 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-01-20 01:35:24 +0100 |
commit | 9640cdaace86da5d6f197016a4c9b8241e23a807 (patch) | |
tree | 932ffd800dfff869fce83c7dbdc0e13bb1fb5345 /src/dhcpv6.c | |
parent | 9a7822288bed6100cd920431ceb65f056e6e53f8 (diff) | |
download | connman-9640cdaace86da5d6f197016a4c9b8241e23a807.tar.gz connman-9640cdaace86da5d6f197016a4c9b8241e23a807.tar.bz2 connman-9640cdaace86da5d6f197016a4c9b8241e23a807.zip |
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.
Diffstat (limited to 'src/dhcpv6.c')
-rw-r--r-- | src/dhcpv6.c | 21 |
1 files changed, 7 insertions, 14 deletions
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; |