diff options
author | yatta | 2023-10-20 01:12:13 +0800 |
---|---|---|
committer | Gert Doering | 2023-12-26 21:16:03 +0100 |
commit | 3e30504d86f0fe5556acc0cb8e6975c5b2277661 (patch) | |
tree | d377520c5d6432c5f8985201fb4f658ce499f704 | |
parent | 6ff816142c1acdaee149c4daabb297fefc2ccde0 (diff) | |
download | openvpn-3e30504d86f0fe5556acc0cb8e6975c5b2277661.zip openvpn-3e30504d86f0fe5556acc0cb8e6975c5b2277661.tar.gz |
fix(ssl): init peer_id when init tls_multi
When openvpn run in UDP server mode, if ssl connections reach the
max clients, the next connection would be failed in `multi_create_instance`
and the half connection will be close in `multi_close_instance`, which
may lead array `m->instances[0]` covered unexpectedly and make the
first connection interrupt, this patch fix this problem by init `peer_id`
with `MAX_PEER_ID` in `tils_multi_init`.
Signed-off-by: yatta <ytzhang01@foxmail.com
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <tencent_C49D67EAA5678D180C293706A9469EFE8307@qq.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27260.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
-rw-r--r-- | src/openvpn/ssl.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c index 7597412..33c8670 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -64,6 +64,7 @@ #include "dco.h" #include "memdbg.h" +#include "openvpn.h" #ifdef MEASURE_TLS_HANDSHAKE_STATS @@ -1148,6 +1149,7 @@ tls_multi_init(struct tls_options *tls_options) /* get command line derived options */ ret->opt = *tls_options; ret->dco_peer_id = -1; + ret->peer_id = MAX_PEER_ID; return ret; } |