From: "plaisthos (Code Review)" Date: Wed, 12 Feb 2025 11:53:33 +0000 References: Reply-To: arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <2b2c2ce448a19249ae4eb7c7ec9674092e2908af-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="ff/JslbO5VQ="; 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: flichtenheld Cc: openvpn-devel --ff/JslbO5VQ= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/891?usp=3Demail to review the following change. 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 --- M src/openvpn/init.c 1 file changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/91/891/1 diff --git a/src/openvpn/init.c b/src/openvpn/init.c index a7f7db4..b5eeeb8 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -4390,6 +4390,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: 1 Gerrit-Owner: plaisthos Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-Attention: flichtenheld Gerrit-MessageType: newchange --ff/JslbO5VQ= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld.

plaisthos would like flichtenheld to review this change.

Vi= ew Change

Reconnect when TCP is on use on network-change management com=
mand

On some newer Android handsets, changing to a different network=
often does not trigger a TCP reset but continues using the old
conne= ction (e.g. using mobile connection when WiFi becomes available)

For= ce a reconnect in these situation to have a more expected beheaviour.
Change-Id: Id4febcceecab33ee5189cd67b249a15d12b84799
Signed-off-by: Ar= ne Schwabe <arne@...1227...>
---
M src/openvpn/init.c
1 file= changed, 9 insertions(+), 0 deletions(-)

git pull ssh://gerrit.o=
penvpn.net:29418/openvpn refs/changes/91/891/1
diff --git a/src/ope=
nvpn/init.c b/src/openvpn/init.c
index a7f7db4..b5eeeb8 100= 644
--- a/src/openvpn/init.c
+++ b/src/open= vpn/init.c
@@ -4390,6 +4390,15 @@
= return -1;
}

+ /* On some newer Android handsets, ch= anging to a different network
+ * often does not trigger a TCP reset but continue using the = old
+ * connectio= n (e.g. using mobile connection when WiFi becomes available */
+ struct link_socket_info *lsi= =3D get_link_socket_info(c);
+ if (lsi && proto_is_tcp(lsi->proto) && !sa= menetwork)
+ {
+ return -2;
+ }
+
socketfd =3D c-&g= t;c2.link_sockets[0]->sd;
if (!c->options.pull |= | c->c2.tls_multi->use_peer_id || samenetwork)
{=

To view, visit 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: 1
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-MessageType: newchange
--ff/JslbO5VQ=--