From: "cron2 (Code Review)" Date: Sat, 15 Feb 2025 15:36:39 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <716fd2b5919d4a49cae46289f5b0cba3b3765aff-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="CwXctDTNoJY="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Reconnect when TCP is on use on network-change management command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: flichtenheld , openvpn-devel --CwXctDTNoJY= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/89= 1?usp=3Demail ) Change subject: Reconnect when TCP is on use on network-change management c= ommand ...................................................................... Reconnect when TCP is on use on network-change management command On some newer Android handsets, changing to a different network often does not trigger a TCP reset but continues using the old connection (e.g. using mobile connection when WiFi becomes available) Force a reconnect in these situation to have a more expected beheaviour. Change-Id: Id4febcceecab33ee5189cd67b249a15d12b84799 Signed-off-by: Arne Schwabe Acked-by: Gert Doering Message-Id: <20250215152456.5691-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg30= 908.html Signed-off-by: Gert Doering --- M src/openvpn/init.c 1 file changed, 9 insertions(+), 0 deletions(-) diff --git a/src/openvpn/init.c b/src/openvpn/init.c index da20241..920f8d7 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -4412,6 +4412,15 @@ return -1; } + /* On some newer Android handsets, changing to a different network + * often does not trigger a TCP reset but continue using the old + * connection (e.g. using mobile connection when WiFi becomes availabl= e */ + struct link_socket_info *lsi =3D get_link_socket_info(c); + if (lsi && proto_is_tcp(lsi->proto) && !samenetwork) + { + return -2; + } + socketfd =3D c->c2.link_sockets[0]->sd; if (!c->options.pull || c->c2.tls_multi->use_peer_id || samenetwork) { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/891?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Id4febcceecab33ee5189cd67b249a15d12b84799 Gerrit-Change-Number: 891 Gerrit-PatchSet: 2 Gerrit-Owner: plaisthos Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-MessageType: merged --CwXctDTNoJY= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 submitted this change.

View Change

Reconnect when TCP is on use on network-change=
 management command

On some newer Android handsets, changing to a di= fferent network
often does not trigger a TCP reset but continues using t= he old
connection (e.g. using mobile connection when WiFi becomes availa= ble)

Force a reconnect in these situation to have a more expected be= heaviour.

Change-Id: Id4febcceecab33ee5189cd67b249a15d12b84799
Si= gned-off-by: Arne Schwabe <arne@...1227...>
Acked-by: Gert Doering= <gert@...1296...>
Message-Id: <20250215152456.5691-1-gert@...1386...= 296...>
URL: https://www.mail-archive.com/openvpn-devel@...1535...= orge.net/msg30908.html
Signed-off-by: Gert Doering <gert@...1296...&g= t;
---
M src/openvpn/init.c
1 file changed, 9 insertions(+), 0 del= etions(-)

diff --git a/src/openvpn/init.c b/src/openvpn/init.c
ind= ex da20241..920f8d7 100644
--- a/src/openvpn/init.c<= br>+++ b/src/openvpn/init.c
@@ -4412,6 +4412,15 @@
return -1;
}
<= /span>
+ /* On some newer= Android handsets, changing to a different network
+ * often does not trigger a TCP reset bu= t continue using the old
+ * connection (e.g. using mobile connection when WiFi becomes avai= lable */
+ struct = link_socket_info *lsi =3D get_link_socket_info(c);
+ if (lsi && proto_is_tcp(lsi->= proto) && !samenetwork)
+ {
+ = return -2;
+ = }
+
= socketfd =3D c->c2.link_sockets[0]->sd;
if = (!c->options.pull || c->c2.tls_multi->use_peer_id || samenetwork)<= /span>
{

To view, visit <= a href=3D"http://gerrit.openvpn.net/c/openvpn/+/891?usp=3Demail">change 891= . To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Id4febcceecab33ee5189cd67b24= 9a15d12b84799
Gerrit-Change-Number: 891
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: merged
--CwXctDTNoJY=--