Commit c8237432 authored by David Woodhouse's avatar David Woodhouse

Implement esp_close() and esp_shutdown()

Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 70d26b83
......@@ -332,8 +332,20 @@ int esp_mainloop(struct openconnect_info *vpninfo, int *timeout)
void esp_close(struct openconnect_info *vpninfo)
{
/* We close and reopen the socket in case we roamed and our
local IP address has changed. */
if (vpninfo->dtls_fd != -1) {
closesocket(vpninfo->dtls_fd);
unmonitor_read_fd(vpninfo, dtls);
unmonitor_write_fd(vpninfo, dtls);
unmonitor_except_fd(vpninfo, dtls);
}
}
void esp_shutdown(struct openconnect_info *vpninfo)
{
destroy_esp_ciphers(&vpninfo->esp_in[0]);
destroy_esp_ciphers(&vpninfo->esp_in[1]);
destroy_esp_ciphers(&vpninfo->esp_out);
esp_close(vpninfo);
}
......@@ -257,11 +257,6 @@ void openconnect_vpninfo_free(struct openconnect_info *vpninfo)
#endif
#ifdef DTLS_GNUTLS
gnutls_free(vpninfo->gnutls_dtls_cipher);
#endif
#if defined(ESP_GNUTLS) || defined(ESP_OPENSSL)
destroy_esp_ciphers(&vpninfo->esp_in[0]);
destroy_esp_ciphers(&vpninfo->esp_in[1]);
destroy_esp_ciphers(&vpninfo->esp_out);
#endif
free(vpninfo->dtls_addr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment