mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-10-13 18:12:03 +08:00
print info when a UDP connection is rejected due to time.
This commit is contained in:
+8
-4
@@ -658,15 +658,19 @@ time_t now;
|
|||||||
|
|
||||||
list_for_each(&s->proc_list.head, ctmp, list) {
|
list_for_each(&s->proc_list.head, ctmp, list) {
|
||||||
if (session_id_size == ctmp->dtls_session_id_size &&
|
if (session_id_size == ctmp->dtls_session_id_size &&
|
||||||
memcmp(session_id, ctmp->dtls_session_id, session_id_size) == 0 &&
|
memcmp(session_id, ctmp->dtls_session_id, session_id_size) == 0) {
|
||||||
(now - ctmp->udp_fd_receive_time > UDP_FD_RESEND_TIME)) {
|
|
||||||
UdpFdMsg msg = UDP_FD_MSG__INIT;
|
UdpFdMsg msg = UDP_FD_MSG__INIT;
|
||||||
|
|
||||||
|
if (now - ctmp->udp_fd_receive_time <= UDP_FD_RESEND_TIME) {
|
||||||
|
mslog(s, ctmp, LOG_INFO, "received UDP connection too soon");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
ret = connect(listener->fd, (void*)&cli_addr, cli_addr_size);
|
ret = connect(listener->fd, (void*)&cli_addr, cli_addr_size);
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
e = errno;
|
e = errno;
|
||||||
mslog(s, ctmp, LOG_ERR, "connect UDP socket: %s", strerror(e));
|
mslog(s, ctmp, LOG_ERR, "connect UDP socket: %s", strerror(e));
|
||||||
return -1;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = send_socket_msg_to_worker(s, ctmp, CMD_UDP_FD,
|
ret = send_socket_msg_to_worker(s, ctmp, CMD_UDP_FD,
|
||||||
@@ -676,7 +680,7 @@ time_t now;
|
|||||||
(pack_func)udp_fd_msg__pack);
|
(pack_func)udp_fd_msg__pack);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
mslog(s, ctmp, LOG_ERR, "error passing UDP socket");
|
mslog(s, ctmp, LOG_ERR, "error passing UDP socket");
|
||||||
return -1;
|
break;
|
||||||
}
|
}
|
||||||
mslog(s, ctmp, LOG_DEBUG, "passed UDP socket");
|
mslog(s, ctmp, LOG_DEBUG, "passed UDP socket");
|
||||||
ctmp->udp_fd_receive_time = now;
|
ctmp->udp_fd_receive_time = now;
|
||||||
|
|||||||
Reference in New Issue
Block a user