void dtls_close(struct openconnect_info *vpninfo) { if (vpninfo->dtls_ssl) { DTLS_FREE(vpninfo->dtls_ssl); closesocket(vpninfo->dtls_fd); unmonitor_read_fd(vpninfo, dtls); unmonitor_write_fd(vpninfo, dtls); unmonitor_except_fd(vpninfo, dtls); vpninfo->dtls_ssl = NULL; vpninfo->dtls_fd = -1; } }
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); vpninfo->dtls_fd = -1; } vpninfo->dtls_state = DTLS_SLEEPING; }