From patchwork Wed Feb 12 11:53:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "d12fk (Code Review)" X-Patchwork-Id: 4127 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:948d:b0:5e7:b9eb:58e8 with SMTP id g13csp888051mal; Wed, 12 Feb 2025 03:53:54 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUCFOGACEY+kpE7r7MwovZzGoMhnmlyKaKGFIqtHW3f3aurrJaCv+Ap/fm8lLuolcr8pBvG4zzY7L4=@openvpn.net X-Google-Smtp-Source: AGHT+IHfAA8sLOv9hpIJReGgj/tqSRYg3Jw5PeMHswD+ltMTK1xJjjm0lKQgQn2NxRPXXYrCg4K1 X-Received: by 2002:a05:6870:9728:b0:29e:2da3:3f7b with SMTP id 586e51a60fabf-2b8dac96077mr1262190fac.7.1739361234223; Wed, 12 Feb 2025 03:53:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739361234; cv=none; d=google.com; s=arc-20240605; b=h5E0uUlk2HZ/YGMSNa55NhBKpzps6eWGnSl4BIYkkEVYAcUEaryaBUjV+2oNyvCWRE TwTDX+ZY044al8eVJBnDgubr94l6orrAI+nZirkP8/JH4xb+mQeGX4rGxbBrOh428Dwm UC5SLSx0NTtDGJ17Vb5NXEOahW0Q9hAcUeVGff3zTzqV5NyDAaTbbT51GA1fMOubpiqW ohw107YZ4BqHhfF0I+PX1zMd47NW20eR5X80XI4nmuGtO/sDTcoBvJmo6Pd9JYsRjPaz auXsstZ0Aq0P+cH0AMQK75hZhfsDKCqvTia5i8Un62SKBxdU9mSw+6kXSvL60SBt5nIz 4Maw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:cc:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:user-agent :mime-version:message-id:references:auto-submitted:to:date:from :dkim-signature:dkim-signature:dkim-signature; bh=gzRAm2Hk21eI+ZM5h9eXzIor1spW+p1Y23nbMLIO6Po=; fh=lm0MLPW7DntlrDqRECIiC9JlE1uPxhepE0URYHIf+eE=; b=M8w7CnSCWQcb9lR+IlSdlob50aCpa4EURxxCWNH1vuTsJJ84jTGRrHyVODNbfl5R1M 7VzOwiBW1bFBbbJ9Xp1poI4O8wOEc1GgyXWwEafm8PjR5oUZRY35RkWhGaNHn3DjLJLL dWlKpEewJQQkC+y4dttX6D/pCLmV/YJkRfUc54ZIy/b9dGUD1WwxgjN+Lkf/IF4H3vJ1 qyEGO5KPPzQZYbWiDSrd95hQTnqBF3Chki41r3+1Y1BhNQ6/ZD0oitQ95/8h8PBozH55 vxD9hA5Wn3e9AkfLcJGgJFOqAe6WEXY4OEc5d3khUShZwIV56d55NyxC+pZ4mTO27D3y Y5Pw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="EeSkR/Dt"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="F5qw7Tb/"; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=HPorajy4; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvpn.net; dara=fail header.i=@openvpn.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 586e51a60fabf-2b850a60c4csi9814208fac.67.2025.02.12.03.53.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Feb 2025 03:53:54 -0800 (PST) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="EeSkR/Dt"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="F5qw7Tb/"; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=HPorajy4; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvpn.net; dara=fail header.i=@openvpn.net Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tiBJJ-0003px-Mm; Wed, 12 Feb 2025 11:53:45 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tiBJG-0003pp-08 for openvpn-devel@lists.sourceforge.net; Wed, 12 Feb 2025 11:53:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :Message-ID:Reply-To:References:Subject:List-Unsubscribe:List-Id:Cc:To:Date: From:Sender:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help: List-Subscribe:List-Post:List-Owner:List-Archive; bh=GRuwZYBp1efwCJoVTriLVhRuxVyU7wuzBxKMvpi8/Cw=; b=EeSkR/Dtz2yxfAiOAVuR+ik1rD NkpbMSrISAjNhEcwjvSCWK2aJJdB0OT/pEoiIl73LFqz3796TjAFVkrfkuFWnyAUYXnxlAYoOqIxz Oskjd3p9x+L8fcNEh528es7q1X24uKSNpp9/CouGinMd2P/cm30d6BAS/GuzzM22DUN4=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Reply-To: References:Subject:List-Unsubscribe:List-Id:Cc:To:Date:From:Sender:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help:List-Subscribe:List-Post: List-Owner:List-Archive; bh=GRuwZYBp1efwCJoVTriLVhRuxVyU7wuzBxKMvpi8/Cw=; b=F 5qw7Tb//kAKKtAplRcT3Eo9XbC3L/DxKumAmcFeQAGiO9vUNNfE+UudSZeQUOZnaYeMEZ7eZ0hGLc 40sd1QpOzx2mhSe6mDJGdesf+4XFosMAA6oKGM7VRx/z5mEYoMc3DKmagMnc+iEtKGEfRYoRHD9no vk6bQ4hfjA8sC+Mg=; Received: from mail-wr1-f49.google.com ([209.85.221.49]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1tiBJF-0004L0-6w for openvpn-devel@lists.sourceforge.net; Wed, 12 Feb 2025 11:53:41 +0000 Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-38dcae0d6dcso3028039f8f.1 for ; Wed, 12 Feb 2025 03:53:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1739361214; x=1739966014; darn=lists.sourceforge.net; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from:from:to:cc :subject:date:message-id:reply-to; bh=GRuwZYBp1efwCJoVTriLVhRuxVyU7wuzBxKMvpi8/Cw=; b=HPorajy4oHuww7jUb5oqyINJYlN2oIbi+VpO/CMy3GxtmME3KH56xB87cfXcn2xnZI spiHME3aVtLZF2MeKr0/W1du5QR+8HyCpRwDdfTw4P4i5+Z+MlOGG8bw69CE0G1DC/BU QEs4txRtuwOXMYc8R4Yo7aiToQeCLRyQsEAeLUKTAq5HDIBGXKti8e9bcoZG17J1tB7/ Djizdg3AWsbgJ0XvFK25aInJioT81xZz4WPzb8r882wsQXJi5Lho0+1wfWzV+7yxiwpj paUYCoE6a8VNzwJS/3oGqkfpz+iyE/+q0ZXUA6qhRAFxaLZ7HeEeaCLWydKh5Wc6CD8t GPtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739361214; x=1739966014; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GRuwZYBp1efwCJoVTriLVhRuxVyU7wuzBxKMvpi8/Cw=; b=uodl+VFfjdll3gtwU0qmcX7qnvCzUyD2dndBKKoqtyqG/6KECxFRp+KQqHLhwGdOJc EreoH4YcUVD6YTwa0ZM99vyc692O4Yv1xWGr8w/UwgfxjRgnJcC588ecUy0iAG4GOWHu nZon/mqRggHeb8aIpOGxKXY3fvD2wOOZolHFphTLIBIl6dlGOFPLY/VIkGWvmUwHargR BUKEBbJxC3xv0DgKMZSHkzhIOWeab5rCCyeTk4RBwGOu/LXPl3frLTCu0P43A6ju1O4w k49oTNfpXH9hmbPJTIpNp4uArLj0OeWISLIi53f6Vjps0PEkU5/0VRsTit7o+SuCdDAs qxqA== X-Gm-Message-State: AOJu0Yx1dBJecjo4Y5KDLSjnOXVhNGzFH/rP6HQ5RD6rotvoyhBLgPqZ 2525bL+jzIOc8y/PZIx6oBBL5aK9M6rN5W3rY+y+IVNSGSDqPqwjOdXQF1J4W2gxLWdKGtIPNkm N X-Gm-Gg: ASbGncultKSLmCrGR2RVxAqP6quVK07S5ZhvBC7fyPzqWgQ5sAavZKTSXRsmu/cNwpa EjxAVnQqPzNN5AfUTSulSnhOcVkdZW1V6JEeEv6Y7l+osXwoXYZf0TQpgXMSDCUU46NZS5J0hrX p8/lo9LokGFfEfPLcQdBKJrK1AYmK8MA96t1IfXpuxUH3Abay6rnLmJJ4syiPbhsLvIlnEvsxdF 8JEQtXMYWrl4oe/XB4vnJnH3CbGxqexUr1cxeyJdRAnIR6waKx1WaBsGDJjuSm25nEh1p4SizUM q+VZ0q1bFspb7M4tgJ4bbVd+HAzI1W5E2+Vjlc6BoooI30IveLV9l75q2U6nJSH41/3FWdreSdL apOUzc5w= X-Received: by 2002:a05:6000:1f8f:b0:38d:e420:398d with SMTP id ffacd0b85a97d-38dea256ecfmr2172598f8f.6.1739361214391; Wed, 12 Feb 2025 03:53:34 -0800 (PST) Received: from gerrit.openvpn.in (ec2-18-159-0-78.eu-central-1.compute.amazonaws.com. [18.159.0.78]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38dc5839877sm15614879f8f.3.2025.02.12.03.53.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2025 03:53:34 -0800 (PST) From: "plaisthos (Code Review)" X-Google-Original-From: "plaisthos (Code Review)" X-Gerrit-PatchSet: 1 Date: Wed, 12 Feb 2025 11:53:33 +0000 To: flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: Id4febcceecab33ee5189cd67b249a15d12b84799 X-Gerrit-Change-Number: 891 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: e2e36469b41e59187297eaf3dd96cf0b71a70de0 References: Message-ID: <2b2c2ce448a19249ae4eb7c7ec9674092e2908af-HTML@gerrit.openvpn.net> MIME-Version: 1.0 User-Agent: Gerrit/3.8.2 X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Attention is currently required from: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit Content analysis details: (-0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [209.85.221.49 listed in sa-accredit.habeas.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [209.85.221.49 listed in bl.score.senderscore.com] 0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.221.49 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.221.49 listed in list.dnswl.org] 0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP 0.0 HTML_MESSAGE BODY: HTML included in message -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1tiBJF-0004L0-6w Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Reconnect when TCP is on use on network-change management command X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: arne-openvpn@rfc2549.org, openvpn-devel@lists.sourceforge.net, frank@lichtenheld.com Cc: openvpn-devel Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1823852445630313342?= X-GMAIL-MSGID: =?utf-8?q?1823852445630313342?= X-getmail-filter-classifier: gerrit message type newchange 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=email to review the following change. Change subject: Reconnect when TCP is on use on network-change management command ...................................................................... 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 available */ + struct link_socket_info *lsi = get_link_socket_info(c); + if (lsi && proto_is_tcp(lsi->proto) && !samenetwork) + { + return -2; + } + socketfd = c->c2.link_sockets[0]->sd; if (!c->options.pull || c->c2.tls_multi->use_peer_id || samenetwork) {