From patchwork Fri Feb 16 15:50:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "flichtenheld (Code Review)" X-Patchwork-Id: 3623 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:a042:b0:554:adf7:68e6 with SMTP id bi2csp1118688mab; Fri, 16 Feb 2024 07:51:22 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVlsLV8r4TuRzTlAgJ4ARdJXA+PT78iezDF5mC3ZE5NW5fLJv9rdx6gMcpfUPeZKiU+RHsJ2y8PyU5xFr27Rp2duTy4zBM= X-Google-Smtp-Source: AGHT+IEllgwhLAXE8XI25MjQ0UqDdUR9IhiEsBdGGzEGGh+APMv/s49rf9hkyPSB2uFZM17y3UlV X-Received: by 2002:a17:903:2447:b0:1db:3ee6:e432 with SMTP id l7-20020a170903244700b001db3ee6e432mr2763528pls.3.1708098681879; Fri, 16 Feb 2024 07:51:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708098681; cv=none; d=google.com; s=arc-20160816; b=EWoqQzHUAGJIpuJW95v3LWDL+Pw4hbTRKbA3Jj7g3QFsV6EuFx/d7bzvfPq8SZnpSV CBXcAKZmgMDNHYcXLFQBFUKqhgAXcg5tk1vGfiVzSrUNPovtRBvIyGeDZcmEHlMThYvP xKET5fqSgXut3NcJM7vhnHiCSe8Riva4efYS3cd09MsyEvAz8bGcSd72NmbDB4eUB0V0 YlW54hUG8yukHbRYUC9NG069aHdtP6uVqme7ODlwzDyVQjgV5Yswubjfu0J0Dac4M7U7 M79LbnoI2mt/NJWpgsVzXFgyCdNjqGLV/7r6fCWbFaMLwXsYuNKsrcuowFRvqvBn/KfY t8gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=GcRU2d0r8cfX0zcM/f52/oFcoMDtHy1oCSjkPgGejGI=; fh=U7wEyxtwz2o5+UdevFSA47vNeG9knhWH0KV//QhD5a0=; b=Q6mUmPZpAwgjWqukeLcHTTTm4N97uPoLY6nkJgQPwlLOy1tmW6GNv5GcP+zAJciyae wZoAI4a0jtBFW1Dba60cs+0SRk11Cd0cKK/8V/7AJ1jRiUq0bS05rap6fR4rCEQ9u+Tr lHIBh59ulXt1X/twnstlmyObsSxnr2v/3FrUtHJVsx3xNmgkG2iZRzjZpZ+y7NKG2h/H ad4Kdpmb28LYVGRSFO0Z1nEI+Q5x2P1MxdyyaPmnZXiJpo+7ahtQd7SY6tX+oO6cSGkP 539FNfxvK4vc4V2SNt0wTrkTg1f2NmD/GRSCZCkbLsyxMyXw/tcPrrLdlu5vauZM+TRk EFbg==; 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=Rn25bszI; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=EzWzXqNU; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=Kn8ypJZk; 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 Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id j15-20020a170902da8f00b001db9a8c79a6si31333plx.627.2024.02.16.07.51.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Feb 2024 07:51:21 -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=Rn25bszI; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=EzWzXqNU; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=Kn8ypJZk; 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 Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1rb0UH-0000q4-NJ; Fri, 16 Feb 2024 15:50:54 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rb0UG-0000py-RF for openvpn-devel@lists.sourceforge.net; Fri, 16 Feb 2024 15:50:53 +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=WBPcnL6m+SJJfnmTi/UeQOwypWXS2FvEp1HU72Z7RSc=; b=Rn25bszIVadbs6Gpl6CMTMTCSw 910GzGc79+Xt+EldubWSeZZ8NQY07zK6lXEbamTROK3aYMaTr4m5U2SnrqsCp9cKGwy2Ji3PEoxI+ Z90jQBZ+6KsUPj7u6h9oWKbGoJ8m1Z9D92RHNQigBY3VUdGj4OZ90y2GigXu+wvYuYzU=; 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=WBPcnL6m+SJJfnmTi/UeQOwypWXS2FvEp1HU72Z7RSc=; b=E zWzXqNUZv7Xx1b1O8ojyOxuX0ODAZUdB394XKEt+XFIXN+fzJXsFJR5VFVlZD+OhDnI1++ucJXxK5 i2tRfofMLaKXk6VXk1P/igpI0SuYsuMyjW6+zEer1vWsBdHBW0opFZqadOUMMKvFnY1EesF2oifyc aJQDz0/eYcF2vMJs=; Received: from mail-lj1-f170.google.com ([209.85.208.170]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1rb0UC-0000RO-LA for openvpn-devel@lists.sourceforge.net; Fri, 16 Feb 2024 15:50:53 +0000 Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2d0a4e8444dso8719701fa.2 for ; Fri, 16 Feb 2024 07:50:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1708098638; x=1708703438; 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=WBPcnL6m+SJJfnmTi/UeQOwypWXS2FvEp1HU72Z7RSc=; b=Kn8ypJZkDw/EWf7JoKihLn9Lc3Tk+mx91gOMajjdvwcV394PJlzWIa7TjfJ/ieJKDw M5/LINgT3L2qIDll4cD7xO5wuQDQrW81iu7IHOKUdYKJNupOxoAAkfA/B1JOUraVwHyT j5ScXSA52CDXcKV7fTP0xWbAf3PqNAFONSwZit1QBWnvSNfUfup0/IOhaTrSKRQlbQbw CIQnTVkZBhnqmoeMK0k7YsAHfOGt44ScFcmHVvGa+WKgBsBRuoIC9vog2prU7weYd8ki eRiK2aIflHdkOauJ8PkLfNFxENcrYFUCHoGMnfpFDdUuzVLHTu5qvQU72ePHJNwzyO/x GRaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708098638; x=1708703438; 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=WBPcnL6m+SJJfnmTi/UeQOwypWXS2FvEp1HU72Z7RSc=; b=IZdMaXsHZ6PIIQt+YE4DwsWINGJvvue9f2+oZ0VxkgvlGjqbxknfvC3aHM6au0j9nz PYmSKYUWCECjj0ktuWBsFYa8mum6SWNQ2jOKCWv9ygGagUyG84cfHfCbx8P+g1dkXRnN 8O7mOySSOMnZiNwvZgxRi1oeG5S8OrcfrKGBWwalwS4sofy5Eccp99zYLhonD9zUU9/T jna8YQxawpZDZ/RH8aATAD++n4o6uF5uKU94hBgnLVIctScY4kMbysuhauDoIKmqam/Z JZPrpgl3+7Q2oZXvmM3eHzc95M3AJMPkg/0QeYvLeh1te/mxZbMtVf2vWJ2lW8t+u+m8 bDvQ== X-Gm-Message-State: AOJu0YxphReEp3xabdc9lk7SuKlwrNyjS5+VhYKqvavYlM7FYkzYqyBe cvLTyp9iTvTHsnjuqGLl51xmpIRF4tjjEqJamrwEkBKdEHSrnfIbmkNM0dKTig0nyXA03hGS4Xa w X-Received: by 2002:a2e:80cc:0:b0:2d0:a4e1:6dea with SMTP id r12-20020a2e80cc000000b002d0a4e16deamr3754500ljg.26.1708098638220; Fri, 16 Feb 2024 07:50:38 -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 j25-20020a05600c1c1900b004117e45f12esm2739299wms.22.2024.02.16.07.50.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 07:50:37 -0800 (PST) From: "its_Giaan (Code Review)" X-Google-Original-From: "its_Giaan (Code Review)" X-Gerrit-PatchSet: 1 Date: Fri, 16 Feb 2024 15:50:37 +0000 To: plaisthos , flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: Ie147f81e5990b8292be090fd05c23b91f8e308d4 X-Gerrit-Change-Number: 528 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: 75d246fdad940d6c7d9d9ed49f648acb216c2dd8 References: Message-ID: <9ec01a617a8d11bef80e6d23591bd1e0f8236324-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-2.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, plaisthos. Hello plaisthos, 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_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.170 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.208.170 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 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_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 T_SCC_BODY_TEXT_LINE No description available. 0.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1rb0UC-0000RO-LA Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Route: remove incorrect routes on exit 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: gianmarco@mandelbit.com, 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?1791071283780366763?= X-GMAIL-MSGID: =?utf-8?q?1791071283780366763?= X-getmail-filter-classifier: gerrit message type newchange Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/528?usp=email to review the following change. Change subject: Route: remove incorrect routes on exit ...................................................................... Route: remove incorrect routes on exit Implemented a safeguard to verify the returned value from add_route3() when the default gateway is not a local remote host. Prior to this implementation, RT_DID_LOCAL flag was erroneously set even in case of add_route3() failure. This problem typically occurs when there's no default route and the --redirect-gateway def1 option is specified, and in case of reconnection makes it impossible for the client to reobtain the route to the server. This fix ensures OpenVPN accurately deletes the appropriate route on exit by properly handling add_route3() return value. Fixes: Trac #1457 Change-Id: Ie147f81e5990b8292be090fd05c23b91f8e308d4 Signed-off-by: Gianmarco De Gregori --- M src/openvpn/route.c 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/28/528/1 diff --git a/src/openvpn/route.c b/src/openvpn/route.c index 6c027d9..6ab4392 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -1055,7 +1055,10 @@ ret = add_route3(rl->spec.remote_host, IPV4_NETMASK_HOST, rl->rgi.gateway.addr, tt, flags | ROUTE_REF_GW, &rl->rgi, es, ctx); - rl->iflags |= RL_DID_LOCAL; + if (ret) + { + rl->iflags |= RL_DID_LOCAL; + } } else {