Hi,

On Tue, Dec 07, 2021 at 06:01:59PM +0100, Arne Schwabe wrote:
> Use the functions that directly compute the link mtu instead relying on the
> frame logic.
[..]
> --- a/src/openvpn/mtu.c
> +++ b/src/openvpn/mtu.c
> @@ -61,6 +61,8 @@ frame_calculate_protocol_header_size(const struct key_type 
> *kt,
>      /* Sum of all the overhead that reduces the usable packet size */
>      size_t header_size = 0;
>  
> +    bool tlsmode = options->tls_server || options->tls_client;
> +
>      /* A socks proxy adds 10 byte of extra header to each packet */
>      if (options->ce.socks_proxy_server && proto_is_udp(options->ce.proto))
>      {
> @@ -74,7 +76,10 @@ frame_calculate_protocol_header_size(const struct key_type 
> *kt,
>      }
>  
>      /* Add the opcode and peerid */
> -    header_size += options->use_peer_id ? 4 : 1;
> +    if (tlsmode)
> +    {
> +        header_size += options->use_peer_id ? 4 : 1;
> +    }

We need a v2 of this - these two hunks are already in master.

gert
-- 
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             g...@greenie.muc.de

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to