]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Set o->use_peer_id flag for p2p mode
authorLev Stipakov <lev@openvpn.net>
Tue, 24 May 2022 09:19:16 +0000 (12:19 +0300)
committerGert Doering <gert@greenie.muc.de>
Thu, 23 Jun 2022 13:22:37 +0000 (15:22 +0200)
There are two flags to indicate peer-id usage, one is
in tls_multi struct and another one is in options.

For P2P mode we don't set this flag in options,
which is used in MTU calculation. As a result,
automatically calculated MSS value in P2P mode is wrong,

Fix by bring use_peer_id flag in options and tls_multi
into sync for P2P.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Antonio Quartulli <a@unstable.cc>
Message-Id: <20220524091916.145-1-lstipakov@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg24430.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/init.c

index 6cdcef6280f3bc775cad2f7d61e67841c4280016..638fd10c8dd7274e01288e7cca32ff3b834b403e 100644 (file)
@@ -2144,6 +2144,8 @@ do_deferred_p2p_ncp(struct context *c)
         return true;
     }
 
+    c->options.use_peer_id = c->c2.tls_multi->use_peer_id;
+
     struct tls_session *session = &c->c2.tls_multi->session[TM_ACTIVE];
 
     const char *ncp_cipher = get_p2p_ncp_cipher(session, c->c2.tls_multi->peer_info,