[PATCH v1] Fix extracting IV_MTU

Gert Doering <[email protected]>
Newsgroups gmane.network.openvpn.devel
Message-ID <[email protected]>
From: Arne Schwabe <[email protected]>

Commit 06ced3fd accidentally broke extracting the MTU from the peer
info while refactoring the code. Before 06ced3fd the code used
iv_mtu as temporary string and extracted the value into client_max_mtu.
The new code never set client_max_mtu and used iv_mtu as integer instead.

Fix this by setting client_max_mtu again with the real MTU value from
the peer.

Change-Id: Ia2e238a41526ebc178c53d3807103d8b9da475a5
Signed-off-by: Arne Schwabe <[email protected]>
Acked-by: Gert Doering <[email protected]>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1842
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1842
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]>

        
diff --git a/src/openvpn/push.c b/src/openvpn/push.c
index ce2baf2..357b25f 100644
--- a/src/openvpn/push.c
+++ b/src/openvpn/push.c
@@ -717,10 +717,9 @@
     }
 
     /* Push our mtu to the peer if it supports pushable MTUs */
-    int client_max_mtu = 0;
-    unsigned int iv_mtu = peer_info_extract_uint(tls_multi->peer_info, "IV_MTU=");
+    int client_max_mtu = peer_info_extract_uint(tls_multi->peer_info, "IV_MTU=");
 
-    if (iv_mtu != 0)
+    if (client_max_mtu != 0)
     {
         push_option_fmt(gc, push_list, M_USAGE, "tun-mtu %d", o->ce.tun_mtu);
         if (client_max_mtu < o->ce.tun_mtu)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.