[Openvpn-devel,v1] Fix extracting IV_MTU

Message ID 20260813055836.32422-1-gert@greenie.muc.de
State New
Headers
Series [Openvpn-devel,v1] Fix extracting IV_MTU |

Commit Message

Gert Doering Aug. 13, 2026, 5:58 a.m. UTC
  From: Arne Schwabe <arne@rfc2549.org>

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 <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
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 <gert@greenie.muc.de>
  

Patch

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)