From patchwork Fri Feb 14 10:08:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "stipa (Code Review)" X-Patchwork-Id: 4140 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:9b51:b0:5e7:b9eb:58e8 with SMTP id b17csp91651max; Fri, 14 Feb 2025 02:08:58 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWHK3yy8J9F9p7ElE4NcR4c0LMHz+WuJBf/0e16mt9DWXkEPOkIOL6dgl4kbPw8fQhb9/fIves4J+4=@openvpn.net X-Google-Smtp-Source: AGHT+IEMUlRXUrAS6NSD12ZpAvBjZLkv4Y/p2jAUudpEOrui4n5tgYaSCIW+a1CTsw4ZZoSkun+6 X-Received: by 2002:a05:6e02:218d:b0:3cf:b87b:8fde with SMTP id e9e14a558f8ab-3d17bfe505fmr73117375ab.17.1739527738236; Fri, 14 Feb 2025 02:08:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739527738; cv=none; d=google.com; s=arc-20240605; b=Kg8S08nw/XB77Rr1nMNkHxi2j4s/3h5qeGpUg/Y7peVrzWsD3pSjf5mmTq+SCvYZ9J yU48Z1kjm7b+lvsvUzG8pJR6ksNLBGTbdX9b7z3MqEHmwxWo8J8QiwKswxZpktDZmSaH XXsIR9dvGcDJBoDOSiZlUoEHgl4lWRUOq6RBwYnd5cf6SEqZyQWepKK5lJoPV2cUOmfd Bo5fA7CSQe8c4pzyHZYpU17fSE8WUOFjV/GuUfk8uHr7OIrPzMn4FQzFw6UQp4mbKCtg d/sD6f5rZg2hWrVulqwKp14KAP2zr+0oyfzsCwp3MAaZjnexTG6LpWlZxj9l3ENT80dJ JViA== 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=Fh2XPu1qldk5n2YafrZjuKM5Jwltz/0c3Q9Hfu9BhCE=; fh=U7wEyxtwz2o5+UdevFSA47vNeG9knhWH0KV//QhD5a0=; b=Mp6Ena66scmkVCV58GY/l60qy7dvzmZBrY8Wgt09K80YhR606V51acMnP/vIVTnaVE ogIQqOY2h+GfNm2QxOht5idG0iFtFQHpEEicl1ZzBjBZCZhpD1Y78SyPnwK+A8/qHVW5 XyhNMo8XhXPFXyDumWe767zSWOC22QKHvPgMOv9/+KenmyA5yhPBQCDqL9eyZKMu8SRz LXW37zaiUIEZeWnQDWOOKAc7QequYtxvC8dfQFaGr9Vp7lPQ6CH2G4Kso9KkzQXCOMJF wuDFlo9Ia54KUsqTi/8imlbDigQmsGv3fpmjIKeP/jPur0ebQve+Mo2yCGqeMaolzVj4 6y1Q==; 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=gkSLsEu1; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=CrY8zbNI; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=LMF55Ffb; 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 e9e14a558f8ab-3d18f9ca6a6si19561035ab.34.2025.02.14.02.08.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Feb 2025 02:08:58 -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=gkSLsEu1; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=CrY8zbNI; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=LMF55Ffb; 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-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tiscu-0006oJ-3q; Fri, 14 Feb 2025 10:08:52 +0000 Received: from [172.30.29.66] (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 1tiscs-0006o6-Ie for openvpn-devel@lists.sourceforge.net; Fri, 14 Feb 2025 10:08:51 +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=6Q8K+rRlSHRWtxZvdH3ScH2nmFZof8Nv95ItiEWmGrc=; b=gkSLsEu1dyJkTk4bBmOBKnq1ld /f1u0mBw3IQ1fJ7kkwzx+C4Ryecv/qmf7pJznZVbMhXPAQbhfqRKNMLb1JdIWFrDVv74ZinAGssFi an+NzXC4hvCGHf+yA9nErqZpod+Y1E5YMYXvXDLQdFHnAyJto9/Q8prCsoJ0Jkdtzc4s=; 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=6Q8K+rRlSHRWtxZvdH3ScH2nmFZof8Nv95ItiEWmGrc=; b=C rY8zbNI21y13BggNctfa0MSEzA3rmxH9lmuDA5OzXIflqeaeqpJcQjHFc5DA5f9R6HmWolmqdsR9g YUixDmcknvGuvvkRSu6ksQFFLZCu/jOix9yYw2fHfESWM8f0RB+M9HPiJduQWijDUFAaDFg6hHRQJ /BMvcMiW0ZZPb5/I=; Received: from mail-wm1-f44.google.com ([209.85.128.44]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1tiscs-0005pA-AO for openvpn-devel@lists.sourceforge.net; Fri, 14 Feb 2025 10:08:51 +0000 Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-43962f7b0e4so10360835e9.3 for ; Fri, 14 Feb 2025 02:08:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1739527724; x=1740132524; 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=6Q8K+rRlSHRWtxZvdH3ScH2nmFZof8Nv95ItiEWmGrc=; b=LMF55FfbdT9zTppQJODGHs8gvBvlcyizCnWYGh9p9W9YzPw6IBVQadtx/pdlp6xCgX iWMC4+H6dmfr1rEPTneTmMkEExsnAWECYHjHXuB/rSmz71PA8CxPcLiiNwB7jgxb9o5m 6cwtzgABclm6RLgUDbZ7ejXDeiL9fLtkmksXkPfD6YJ9qmwY+UYn+s5uaBMls4OwupSE w8mIud1w1/TncHAMZtVY4G1gFu3p7IsPi7POA3P5KJhmOfJDQUPUYt1ZBNv3cl6dCKOo SI2aqp7LBBI3gdU0SpWIYHOBbdmKLI6CnAKkYnX14QihffW14QJToDNOVqcqodm33fYI +Qfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739527724; x=1740132524; 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=6Q8K+rRlSHRWtxZvdH3ScH2nmFZof8Nv95ItiEWmGrc=; b=E2AQZUieiv3cGE2RcCZRr9RAiwGcoNZOPylrlkf3vOEPjxL5Qikr6ghgHbIFjsvQ1S bf4MjPzAxPYgtDSM9Za5tQSN6zlP6+4C+Ttrq+uyN3QhUPaSFcypvpTgEePviyIWGqR7 EPnlBM7fxLLB/yTvGrR6HkyGP52YT4YX0msflZylQbKZhgHjJtGRuBwB71T0cgLPftdH txsHVihSK8pwTpXR4aHoHqCF1l8HqImzFpYIA+uPri3q8KU8/fzWAJnu5dT45BA6mqSm /sTsVaSDyv/bVuCe3a7STfzVTVTgXNO1rCEQILtr+jlVB+blx9zWHDZhyR94eBYqwNUD BZiw== X-Gm-Message-State: AOJu0YxYs1jROJOcS+YIHXVoh3fgJ3tTGRI1WVKla51EXzzSo5Y56PUA +9kmuB0yGS2D/MReDUGRgcedhhHZ+fR84fX1BmFoNC1DhGG8rqJ4L6OqzknXp90= X-Gm-Gg: ASbGnct9fBiACbEOx9pW6yCFKz52oSBW8feKwC2aXtMHIjIBMGNJb4t2EpfcvZl1+0e QrrjRt1dCFXsRKpOEteDFasCtiME2njj+HuJHaHeARvSzv8LGblyLyaw1PR6BH7QDcQb9QtT0Y4 dYxyFLFXDYy42/R6aP75NmXiZS6T8N1Kb/PZ6ad/+uz08PkMA5Fc4dfj3tUMCDYkkfDaeCbCvBM yUetmnIEr+KcGDIgFhpvFug+0cR8DOWUyOPlhVYWLgK8I1CEdKa3L9zPzYMYvU4PGBDqcGRmBWP pqOHi1LkBsrcGaY2J8ClaaHTPrr/oF6w3j37ved9rhsKQ5TI43IMbB7huPt0hWfjNQWZirDtZeq D8JjOPV4= X-Received: by 2002:adf:f5d1:0:b0:38f:2086:285a with SMTP id ffacd0b85a97d-38f244e8d84mr7198137f8f.23.1739527723596; Fri, 14 Feb 2025 02:08:43 -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-38f2591570esm4259190f8f.59.2025.02.14.02.08.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2025 02:08:43 -0800 (PST) From: "mrbff (Code Review)" X-Google-Original-From: "mrbff (Code Review)" X-Gerrit-PatchSet: 1 Date: Fri, 14 Feb 2025 10:08:42 +0000 To: plaisthos , flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: I02afe6817433ca21aae76671c35151ec6a066933 X-Gerrit-Change-Number: 898 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: 9d8ad6c40a3c6d6b90e8b6d0ca4e57c7a107d002 References: Message-ID: <0dba758edd244d445ee3d428b13cb034333ba62b-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_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.128.44 listed in sa-accredit.habeas.com] 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.128.44 listed in bl.score.senderscore.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.128.44 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.44 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches 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 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_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.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1tiscs-0005pA-AO Subject: [Openvpn-devel] [XS] Change in openvpn[master]: get_dafault_gateway(): Make sure the get_default_gateway() function n... 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: marco@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?1824027037607631656?= X-GMAIL-MSGID: =?utf-8?q?1824027037607631656?= 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/+/898?usp=email to review the following change. Change subject: get_dafault_gateway(): Make sure the get_default_gateway() function never receives IPV4_INVALID_ADDR as a destination. ...................................................................... get_dafault_gateway(): Make sure the get_default_gateway() function never receives IPV4_INVALID_ADDR as a destination. Change-Id: I02afe6817433ca21aae76671c35151ec6a066933 Signed-off-by: Marco Baffo --- M src/openvpn/options.c M src/openvpn/route.c 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/98/898/1 diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 218d8a6..8b7fee4 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -5872,7 +5872,7 @@ get_ipv6_addr(p[1], &remote_ipv6, NULL, M_WARN); } net_ctx_init(NULL, &net_ctx); - get_default_gateway(&rgi, remote_ipv4, &net_ctx); + get_default_gateway(&rgi, remote_ipv4 != IPV4_INVALID_ADDR ? remote_ipv4 : INADDR_ANY, &net_ctx); get_default_gateway_ipv6(&rgi6, &remote_ipv6, &net_ctx); print_default_gateway(M_INFO, &rgi, &rgi6); openvpn_exit(OPENVPN_EXIT_STATUS_GOOD); /* exit point */ diff --git a/src/openvpn/route.c b/src/openvpn/route.c index d895e1c..bc41492 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -655,7 +655,7 @@ rl->spec.flags |= RTSA_DEFAULT_METRIC; } - get_default_gateway(&rl->rgi, remote_host, ctx); + get_default_gateway(&rl->rgi, remote_host != IPV4_INVALID_ADDR ? remote_host : INADDR_ANY, ctx); if (rl->rgi.flags & RGI_ADDR_DEFINED) { setenv_route_addr(es, "net_gateway", rl->rgi.gateway.addr, -1);