public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/openconnect] epel10: Backport upstream commit 5fec1e2: Fix Cisco DTLS MTU detection
@ 2026-11-12 17:26 Angelo Theodorakis
0 siblings, 0 replies; only message in thread
From: Angelo Theodorakis @ 2026-11-12 17:26 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/openconnect
Branch : epel10
Commit : 15c603c9899403290395dc7a9d2b5ebe150979ea
Author : Angelo Theodorakis <angelotheo@meta.com>
Date : 2026-04-27T17:30:14+01:00
Stats : +134/-1 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/openconnect/c/15c603c9899403290395dc7a9d2b5ebe150979ea?branch=epel10
Log:
Backport upstream commit 5fec1e2: Fix Cisco DTLS MTU detection
---
diff --git a/openconnect-5fec1e2-fixed.patch b/openconnect-5fec1e2-fixed.patch
new file mode 100644
index 0000000..8212262
--- /dev/null
+++ b/openconnect-5fec1e2-fixed.patch
@@ -0,0 +1,129 @@
+From 19a7183c6c712601e2b8303ed9162da1e4c9a289 Mon Sep 17 00:00:00 2001
+From: David Woodhouse <dwmw2@infradead.org>
+Date: Wed, 1 Oct 2025 16:00:10 +0100
+Subject: [PATCH] Fix Cisco DTLS MTU detection
+
+New ASA firmware apparently doesn't send back the same payload in a DPD
+response, so we can't match on it. But it does thankfully still return
+responses of the same length, it seems. And the matching isn't important;
+if *any* packet of the given size gets through, that's good enough for
+the MTU detection. So just match the length.
+
+And once we start looking at it, it looks like the whole thing was hosed
+and would never even retry the same packet size as it was supposed to.
+Fix it all.
+
+Fixes: #823
+
+Signed-off-by: David Woodhouse <dwmw2@infradead.org>
+---
+ dtls.c | 51 ++++++++++++++++++++++++-----------------------
+ www/changelog.xml | 1 +
+ 2 files changed, 27 insertions(+), 25 deletions(-)
+
+diff --git a/dtls.c b/dtls.c
+index 2e723f2a..704c5045 100644
+--- a/dtls.c
++++ b/dtls.c
+@@ -474,7 +474,6 @@ static int probe_mtu(struct openconnect_info *vpninfo, unsigned char *buf)
+ {
+ int max, min, cur, ret, absolute_min, last;
+ int tries = 0; /* Number of loops in bin search - includes resends */
+- uint32_t id, id_len;
+ struct timeval start_tv, now_tv, last_tv;
+
+ absolute_min = 576;
+@@ -492,13 +491,11 @@ static int probe_mtu(struct openconnect_info *vpninfo, unsigned char *buf)
+ if (max <= min)
+ goto fail;
+
+- /* Generate unique ID */
+- if (openconnect_random(&id, sizeof(id)) < 0)
+- goto fail;
+-
+ vpn_progress(vpninfo, PRG_DEBUG,
+ _("Initiating MTU detection (min=%d, max=%d)\n"), min, max);
+
++ memset(buf, 0x5a, max + 1);
++
+ gettimeofday(&start_tv, NULL);
+ last_tv = start_tv;
+
+@@ -527,11 +524,10 @@ static int probe_mtu(struct openconnect_info *vpninfo, unsigned char *buf)
+ #endif
+
+ buf[0] = AC_PKT_DPD_OUT;
+- id_len = id + cur;
+- memcpy(&buf[1], &id_len, sizeof(id_len));
+
+- vpn_progress(vpninfo, PRG_TRACE,
++ vpn_progress(vpninfo, PRG_DEBUG,
+ _("Sending MTU DPD probe (%u bytes)\n"), cur);
++ dump_buf_hex(vpninfo, PRG_TRACE, '>', buf, cur + 1);
+ ret = openconnect_dtls_write(vpninfo, buf, cur + 1);
+ if (ret != cur + 1) {
+ vpn_progress(vpninfo, PRG_ERR,
+@@ -550,7 +546,6 @@ static int probe_mtu(struct openconnect_info *vpninfo, unsigned char *buf)
+ last = cur;
+ }
+
+- memset(buf, 0, sizeof(id)+1);
+ keep_waiting:
+ gettimeofday(&now_tv, NULL);
+
+@@ -576,30 +571,36 @@ static int probe_mtu(struct openconnect_info *vpninfo, unsigned char *buf)
+ wait_ms = PKT_INTERVAL_MS;
+
+ ret = openconnect_dtls_read(vpninfo, buf, max+1, wait_ms);
+- if (ret > 0 && (buf[0] != AC_PKT_DPD_RESP || !memcpy(&id_len, &buf[1], sizeof(id_len)) ||
+- id_len != id + ret - 1)) {
++ if (ret > 0) {
++ dump_buf_hex(vpninfo, PRG_TRACE, '<', buf, ret);
++ if (buf[0] != AC_PKT_DPD_RESP || ret != cur + 1) {
++ vpn_progress(vpninfo, PRG_DEBUG,
++ _("Received unexpected packet (type 0x%02x, %d bytes, expected %d) in MTU detection; skipping.\n"),
++ buf[0], ret, cur + 1);
++ goto keep_waiting;
++ }
++
+ vpn_progress(vpninfo, PRG_DEBUG,
+- _("Received unexpected packet (%.2x) in MTU detection; skipping.\n"), (unsigned)buf[0]);
+- goto keep_waiting;
+- }
++ _("Received MTU DPD probe (%u bytes)\n"), ret - 1);
++ ret--;
++ tries = 0;
++ } else if (ret == -ETIMEDOUT) {
++ if (tries < 6)
++ continue;
+
+- if (ret == -ETIMEDOUT) {
+- if (tries >= 6) {
+- vpn_progress(vpninfo, PRG_DEBUG,
+- _("No response to size %u after %d tries; declare MTU is %u\n"),
+- last, tries, min);
++ vpn_progress(vpninfo, PRG_DEBUG,
++ _("No response to size %u after %d tries (min %d max %d)\n"),
++ last, tries, min, max);
++ if (cur <= max)
++ max = cur - 1;
++ if (cur <= min + 1) {
+ ret = min;
+ goto out;
+ }
+- } else if (ret < 0) {
++ } else {
+ vpn_progress(vpninfo, PRG_ERR,
+ _("Failed to recv DPD request (%d)\n"), ret);
+ goto fail;
+- } else if (ret > 0) {
+- vpn_progress(vpninfo, PRG_TRACE,
+- _("Received MTU DPD probe (%u bytes)\n"), ret - 1);
+- ret--;
+- tries = 0;
+ }
+
+ if (ret == max)
+--
+GitLab
+
diff --git a/openconnect.spec b/openconnect.spec
index c412d64..a7977ec 100644
--- a/openconnect.spec
+++ b/openconnect.spec
@@ -11,7 +11,7 @@
Name: openconnect
Version: 9.12
-Release: 10%{?dist}
+Release: 11%{?dist}
Summary: Open multi-protocol SSL VPN client
License: LGPL-2.1-or-later
URL: https://www.infradead.org/%{name}/
@@ -19,6 +19,7 @@ URL: https://www.infradead.org/%{name}/
Source0: %{url}/download/%{name}-%{version}.tar.gz
Source1: %{url}/download/%{name}-%{version}.tar.gz.asc
Source2: gpgkey-BE07D9FD54809AB2C4B0FF5F63762CDA67E2F359.asc
+Patch0: openconnect-5fec1e2-fixed.patch
BuildRequires: autoconf
BuildRequires: automake
@@ -118,6 +119,9 @@ make VERBOSE=1 check
%{_libdir}/pkgconfig/%{name}.pc
%changelog
+* Mon Apr 27 2026 Angelo Theodorakis <angelotheo@meta.com> - 9.12-11
+- Backport upstream commit 5fec1e2: Fix Cisco DTLS MTU detection
+
* Fri Jan 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 9.12-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-12 17:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-12 17:26 [rpms/openconnect] epel10: Backport upstream commit 5fec1e2: Fix Cisco DTLS MTU detection Angelo Theodorakis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox