From patchwork Thu Feb 15 08:48:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "plaisthos (Code Review)" X-Patchwork-Id: 3616 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:a042:b0:554:adf7:68e6 with SMTP id bi2csp274787mab; Thu, 15 Feb 2024 00:49:53 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWHp1E4m+8oL/ii+46gLU9NU3cFzC9phEa0OM3coqEFPASmZsBOQ22ciBQedS716cmz3Ohe4uCQbtrUoOPCIr0seV04Weg= X-Google-Smtp-Source: AGHT+IEM4d1RGBy5wubSkdbNvOuLspAj5gh+WlGbbi5lNjZ2BwTEJrnOUqhIDswdPxCKfAz6cF5m X-Received: by 2002:a05:6870:fb92:b0:21a:1183:d772 with SMTP id kv18-20020a056870fb9200b0021a1183d772mr963732oab.4.1707986992312; Thu, 15 Feb 2024 00:49:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707986992; cv=none; d=google.com; s=arc-20160816; b=uv69n0F9cPBcYCUBvZQQoVMELH7vXWn8EWGU70NBcdtCYW9MPCR/cmu4lasPYuAOUM w2oEoT5IyGRuXn0hZiwbotfFuvrL1elbCyuVg1qFHV6guPYWVboTnaWYDGjnYyvK/JFJ URuKesiq3MlThRjjSBXhbcOS3cO495HSi6b0uDl0N+Q8Vf+Id1zuKOH8vyKJY+kUEzqK tnlGPKjb+FcqLWb1YAcZnyhY4EHWuYrEJW8324vpxtfy2IYE1r9l0Ki1LNxNWIeouIgl CiQV84IvDVBKrHoQaQqB+JRpdIL8GcceTSGpUKU34m1sLVp7kuTji0JC2UYY89FOnXrn WtvA== 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=0m4osFn2K6DqJFU1AwzIWrbm2ILXud6Hb81/DbbMHc8=; fh=U7wEyxtwz2o5+UdevFSA47vNeG9knhWH0KV//QhD5a0=; b=uBE/ZP02bbyXU5OVuSwE0zvTIALBwVUCnBbTvf3eZQ9wVu2WXuJ14PxnQKh+x5DWGd frUyfBPWCULXMy8CmBuOL3hC6XMub3bqqGPZY0TmTeprawT5SqHqdiXeJvu00R35dd4z GpiM6QQCTAjdLMiSxCnk9i+TCRBCMJ7EnEe5fIqiW1j1MApbrubrZC6RiQJu1vGUGy0B naV/VoiSk+Lu5lZTG6IlFMvQXf6tA/81EDAwoUHGYrEJz1Q4bu3qI/73DiAfY+8bMIDc nz4GjG1wSDzt9vsi7qPcVZxgpEQkZk0ENIHeNAcVFqGGrGQ4kv+Pwzx7FdXDZd4bEGI8 L0ag==; 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=NywpuPbS; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=e4E8QNkv; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=IhMlFIPA; 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 x62-20020a638641000000b005d8b69f8844si797118pgd.498.2024.02.15.00.49.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Feb 2024 00:49:52 -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=NywpuPbS; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=e4E8QNkv; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=IhMlFIPA; 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-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1raXQg-0003Ki-T1; Thu, 15 Feb 2024 08:49:15 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1raXQb-0003KQ-Jv for openvpn-devel@lists.sourceforge.net; Thu, 15 Feb 2024 08:49:10 +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=gvEjiY87/8dIvNuZDe/lcoZIykf46Xq/oJT8TffskPk=; b=NywpuPbS9ZSeB/QPEICOx7K3UP p+JyJQ+bLFhOFfhiKGEbj+mGNB6JDWshsLZP5Hu/g+JdFauAv7TiFIpSMQwL0FvJz+C780NBoeqW+ H++ZCIz/WKAp2wrfpryvJ9+OHeXCyr6QVmlz3avqq5H7AIJoRtNh4R/r6hNWHt7FSm9U=; 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=gvEjiY87/8dIvNuZDe/lcoZIykf46Xq/oJT8TffskPk=; b=e 4E8QNkv9lVl/h07MR/i7JDap/HCOglgY6QMXLWl6I5ETrlY1xfbouKakl4zrqmiGjkGkolRFck52p /Sx/4koalzUsHIAe6qRVul5fyJghmUdYy63gXgKNdAzBK3RlrYpi+sQhy6N5EWHSTkymee5nT5AI7 KN9iG5ApuuJ5EgCE=; Received: from mail-lf1-f48.google.com ([209.85.167.48]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1raXQZ-00070p-8B for openvpn-devel@lists.sourceforge.net; Thu, 15 Feb 2024 08:49:10 +0000 Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-51178bbb5d9so665225e87.2 for ; Thu, 15 Feb 2024 00:49:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1707986936; x=1708591736; 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=gvEjiY87/8dIvNuZDe/lcoZIykf46Xq/oJT8TffskPk=; b=IhMlFIPA1PimM6qu0QTpoYsey2V7lU7ZxkonRM1HLZQzBdJXFnBbx+rosP6jWr0RUK H6e9m2iuasL3cWqXhIwznWKt4BOyekHZKr05rxPJwCG5B3rfNMQs52AmsRr96EdL/7b+ wXZ7T/rzBrNJnZHK0LaCp2okij303t8s3fk+7gA8z38pvuDUnUNOm9lE/xp5QXk7k9SQ YVJo00LaYEMga0X6/iN6mgCNSI8ryAFhFJ+zH4z5SKaxA5FvSaVOg8/331279d6QAV/p B3GVchi7TtGpgMa3KVMT12HiYNw7ocqfukHRz+4r0tycOD11j5DLISY9aGcEwYYpfznI wfdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707986936; x=1708591736; 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=gvEjiY87/8dIvNuZDe/lcoZIykf46Xq/oJT8TffskPk=; b=oAQ9gGCgHYxPcDZs8NS+uBJ86KyBAyksAH8OsflbA4z9FRP5UJi5l55ZC/Mh3DAIFv EMt9kfR0R8Qx0Rg2+Td1VDUqkyFpFoF3o1l6KFpdWxGyuMoyOWpbhBaPajEgkNjHIYjt pjUiqXDvpVglFl9OAPlaBwiSaFwizmlbe2DbhrncFrqRuuWeWjt74/87gFCOygcfGPIb cVntlizeCnea5ZXE7GCBk2GIAidI52TRNnOeEwoQFQXKIdy6OaevyIylfiBK2xOrlOHf DikHhbLy8QSVA/3xjNHTmco0HTt3djDDEbaqVI794+r7A1XV6qDdXZ4m3+2M1SUlpWRZ zUfg== X-Gm-Message-State: AOJu0Yx3DA8LUENF/5tvXnv+1hrUTzE2npcG1cl/V95K8dfpKD2rw/hv VyP6fbe7QsHXI5orOF9YU+mR7ysW9fR6hBydU0UUtfTjA3T5uYVmWk9PruMkaILPf6HpxsexY9f i X-Received: by 2002:a19:5f5e:0:b0:512:86fa:a789 with SMTP id a30-20020a195f5e000000b0051286faa789mr828012lfj.31.1707986936138; Thu, 15 Feb 2024 00:48:56 -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 z5-20020a5d44c5000000b0033b4acb999dsm1056971wrr.98.2024.02.15.00.48.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 00:48:55 -0800 (PST) From: "its_Giaan (Code Review)" X-Google-Original-From: "its_Giaan (Code Review)" X-Gerrit-PatchSet: 1 Date: Thu, 15 Feb 2024 08:48:55 +0000 To: plaisthos , flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: I8a67b82eb4afdc8d82c5a879c18457b41e77cbe7 X-Gerrit-Change-Number: 522 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: 02fb435466741845d2448d35b99938d663c4d3b0 References: Message-ID: <06ebd3fab9ad0435f8b73ec15f89b60111da4228-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, 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_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.167.48 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.167.48 listed in wl.mailspike.net] -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_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.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Headers-End: 1raXQZ-00070p-8B Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Route: remove uncorrect 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?1790954168455122953?= X-GMAIL-MSGID: =?utf-8?q?1790954168455122953?= 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/+/522?usp=email to review the following change. Change subject: Route: remove uncorrect routes on exit. ...................................................................... Route: remove uncorrect 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: I8a67b82eb4afdc8d82c5a879c18457b41e77cbe7 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/22/522/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 {