diff --git a/sslh-select.c b/sslh-select.c index 12c9fe5..95c16e4 100644 --- a/sslh-select.c +++ b/sslh-select.c @@ -468,6 +468,7 @@ void udp_timeouts(struct select_info* fd_info) if (FD_ISSET(i, &fd_info->fds_r) || FD_ISSET(i, &fd_info->fds_w)) { struct connection* cnx = collection_get_cnx_from_fd(fd_info->collection, i); if (cnx && udp_timedout(cnx)) { + close(cnx->target_sock); FD_CLR(i, &fd_info->fds_r); FD_CLR(i, &fd_info->fds_w); collection_remove_cnx(fd_info->collection, cnx); diff --git a/udp-listener.c b/udp-listener.c index a65446d..4d0bb97 100644 --- a/udp-listener.c +++ b/udp-listener.c @@ -137,9 +137,8 @@ int udp_timedout(struct connection* cnx) if (cnx->type != SOCK_DGRAM) return 0; /* Not a UDP connection */ if ((now - cnx->last_active > cnx->proto->udp_timeout)) { - close(cnx->target_sock); if (cfg.verbose > 3) - fprintf(stderr, "disconnect timed out UDP %d\n", cnx->target_sock); + fprintf(stderr, "timed out UDP %d\n", cnx->target_sock); return 1; } return 0;