From patchwork Tue Jan 14 13:14:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "mrbff (Code Review)" X-Patchwork-Id: 4056 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:b7cb:b0:5e7:b9eb:58e8 with SMTP id en11csp2231627mab; Tue, 14 Jan 2025 05:14:36 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVFnu3w27ZIM/rCUXKi3czvzEifj8KrOwPmvp0Km8VreZEXrOx/AKnorNk2lozVgq1QMPPjEx6e6T4=@openvpn.net X-Google-Smtp-Source: AGHT+IG9+8kaN1pk6g0ODss04zixMC9EP2osRxvaY90FU4Qq9PNlzaplVnP5JVzISuXKxZmLsJvp X-Received: by 2002:a05:6830:f86:b0:71d:4a91:9204 with SMTP id 46e09a7af769-721e2f24304mr16746272a34.26.1736860476236; Tue, 14 Jan 2025 05:14:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736860476; cv=none; d=google.com; s=arc-20240605; b=ZyfMDkWFg7GePBJmjRvmt9aOEdDI6tYkx1VZvgACWOnKK2giDblTHkrxY/z325IHq8 r0LWkRkKnX+YF0J+fObmQzBJX1G+LxKYqkyzmf+q/lUqxpFQhcew91PrCB02Ya6TIlAu B4rg110v4aY6nzioDNoCxeXTQ83Mnr1z9oVW0CE0r3PU0kayW3UwH/f9kO1gIddr8L1C 2JXQo8kLmzFL2dIxM48lXIDs0AYYIfoyZ0xhGw6dFHHXOZN691QuOgWjYSj5r6MCT3ic GVqIFhPneXBTzOFWB3z144h4KUtbuOAoRFWFwYuUjS0Ke0EgPoLMy/nYU/79NPDu6Y4A nnww== 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=t4uuWLXBnymKKjKQakG7HMpKE05cPqiENDw91pUx62A=; fh=GFP4qDxgyJ2WEPo/oeLZg3Mj4NqvY1j2nTvTt7psNwg=; b=bz7KiU5xPCasD3xPyS5S5ypHSfv94/VXvtDOFBvOVdxlR+JhEDin+5R7/x68HNKkFx jALNZNV+vSh2/KmogL7LkiC86ngWsjGDYM6UwXSrBC51ZYsG65Kv0AKYeudNVJuJ+edy NMYsDPLGXVGOMgEvJBgRYw8i1nkG7uw687Z38oHEDdX8ytlhbKnJgdXpf+Fs3IsP+HB9 soPszmmWxm1zE7G9WYWkA2J7JUDZV/5dCmXYpRwD/vg3SyL4ViKWnbRE7iwDFqdjdzOq CoiY9gwANCWITbyLpJ6GK66bTR+TOjMP0sBBDTeOsNTY4A383Su9ij3q/LvUfb4StD2a s8AQ==; 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=ikWg0MGZ; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=aTPCSbZm; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=NWuvWi62; 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 46e09a7af769-7231854af3bsi8817039a34.32.2025.01.14.05.14.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Jan 2025 05:14:36 -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=ikWg0MGZ; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=aTPCSbZm; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=NWuvWi62; 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-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tXgka-0004a9-1U; Tue, 14 Jan 2025 13:14:31 +0000 Received: from [172.30.29.66] (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 1tXgkZ-0004a0-Ew for openvpn-devel@lists.sourceforge.net; Tue, 14 Jan 2025 13:14:30 +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=ltNWwrk2lMHv7vAbras1c5p3a1dQnJYqLiG02yZkrzQ=; b=ikWg0MGZfTEWA2gBG091e8/Ibl Wq8eIaDyG92f80ZrwCOo6hlGqbcku+LNIaUHroHQz/3/Kb7bm7gsCNmWu2pkHbbX9Jw8XFHoaf3N2 AqyUJyJPbVVnrHylmKR/fdpmY2sGq5yHvNwY1FqEw/T1VI31RvVpTkzJCYn0AHkqUZWA=; 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=ltNWwrk2lMHv7vAbras1c5p3a1dQnJYqLiG02yZkrzQ=; b=a TPCSbZmt6t5ol4BxGfU9eI/Yl/onOJNKOnSjxPY+yFt5Pm5o+WsVqjAu2CoPYDz3JolLMb0syt2/h vLYlD+QQ5RqRFagzokFD+Hhd4uhH9+WClDc2dJ+Y+FGUq+c9sZ5uElfkeVy0Id6YOQ79K1DxK+9dZ 0NYFBK70stcqA3dQ=; Received: from mail-wm1-f46.google.com ([209.85.128.46]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1tXgkX-0003jU-Rj for openvpn-devel@lists.sourceforge.net; Tue, 14 Jan 2025 13:14:30 +0000 Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4361f796586so56864415e9.3 for ; Tue, 14 Jan 2025 05:14:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1736860458; x=1737465258; 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=ltNWwrk2lMHv7vAbras1c5p3a1dQnJYqLiG02yZkrzQ=; b=NWuvWi629oKOSOSgZ0KHTlvkWg8HFW2gUc/Lzx9BjNvGQUrEzkF7QdTDobhy+fC8rO GrUcJTo+sTn2YZiGj262RrUctOiAppjDaG1XUEyPk/vUwAs4bw0EBrOO3Oxhp2C4EVy/ 5e0FHt9bwqq/PP9Qq/zRfb/VtjMRl28Bic/5BATBRNnJ3usqAucgDaBcxTdjn5+z0PC7 3wwl+AV3eZ9fxCHCSDPVKBU3LkdH+eZtQr3lFlMl6jExNKKXUgBwZU7IlfAA87yJ9wU4 c5YyS8+29Q0ljQyXNOI2dLUseDZfazflw6mQna1/E7tEYJrMQ04jqaKii3YU6X19oRjp /9Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736860458; x=1737465258; 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=ltNWwrk2lMHv7vAbras1c5p3a1dQnJYqLiG02yZkrzQ=; b=OKLwrvOuI9KlUcP/06B5f61+1w98YJo4e/lOfNacRcOPKM78rE3XFpN80dzLtgLRI8 +gMAE6WVOgdihBiFJvEF8NLGzawspyLdJRGVVxFMEdP2dFsHDcweewieJxHRNLTYMbE/ quZylPC2OOVEovEt8oN0t5xmryKzCCh9YZrFoHzURcfGfGP55PuvOuFkwIdXZzP9a8k9 IEClAO4m0O9KiBYgtY20al47gJRdyXoLAwotnWQ2OxyEQe1TMMmXuyZO+HW8VdYoDgKu STbMgC2gzZ2c7omQbRrfzh0O6AcMXpSKRjwiaHRgxQuKxOzFOBIwiNU5wLA01CLDdku/ rpDw== X-Gm-Message-State: AOJu0YwUrWxNVUQKjAGzLW/oIHDPbTwbxihK5ajaxF4RS0rkLtwvwfoS 1wCCl1Wn0tMdtRsCecA1yKG0ysI0slv2IWxbbSn/9AUtp47Cps7BHhSVYAtl8h636QmDGk4iJds g X-Gm-Gg: ASbGncvuQdMFNjffGZo3jurWNXKGds3FatIvsjWGdM4/h2ouf7rYnrN3jKQgwuKkd4A VCvetJd+ShPEPgzAMxuuamtojfJ/OooCYA6PVJ/xYTsud8ovmoVwgCHoBDK7y1jiDmiXyrDPgAo CEUdQfFKRsWV8l0FTZbP3ktXUGbcp5vxHuqMzjnjzri+H/7QEqvtBfPDfY/LSjftGQF2bGeD81J rIM+6E8FDAOi1QvSvQ7sUKaLguQlSrPZOGK7g4F0Dn7baKcuae8CFa8WQYJghd36YTinS8+0bOD WqdXgowthsIbHN4rDjCO6SrTwCH8bt6Rjx9YqhvXh9EifvuY X-Received: by 2002:a05:600c:4f4e:b0:436:1ac2:1acf with SMTP id 5b1f17b1804b1-436e26e28cemr215800275e9.20.1736860458081; Tue, 14 Jan 2025 05:14:18 -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 5b1f17b1804b1-436e2dc0babsm208883295e9.14.2025.01.14.05.14.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 05:14:17 -0800 (PST) From: "flichtenheld (Code Review)" X-Google-Original-From: "flichtenheld (Code Review)" X-Gerrit-PatchSet: 1 Date: Tue, 14 Jan 2025 13:14:17 +0000 To: plaisthos Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: I1918c43202b87f0c987bfd9155c739da7dd02632 X-Gerrit-Change-Number: 865 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: 6b8b756dccb42c570371de3b5d890a0e9bff0223 References: Message-ID: MIME-Version: 1.0 User-Agent: Gerrit/3.8.2 X-Spam-Score: -2.0 (--) 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: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit Content analysis details: (-2.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_SAFE_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.46 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.46 listed in bl.score.senderscore.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.128.46 listed in list.dnswl.org] -1.8 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.46 listed in wl.mailspike.net] 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_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.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1tXgkX-0003jU-Rj Subject: [Openvpn-devel] [S] Change in openvpn[master]: Fix some trivial sign-compare compiler warnings 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: frank@lichtenheld.com, arne-openvpn@rfc2549.org, openvpn-devel@lists.sourceforge.net Cc: openvpn-devel Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1821230210816298463?= X-GMAIL-MSGID: =?utf-8?q?1821230210816298463?= X-getmail-filter-classifier: gerrit message type newchange Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/865?usp=email to review the following change. Change subject: Fix some trivial sign-compare compiler warnings ...................................................................... Fix some trivial sign-compare compiler warnings Change-Id: I1918c43202b87f0c987bfd9155c739da7dd02632 Signed-off-by: Frank Lichtenheld --- M src/openvpn/options.c M src/openvpn/socket.c M src/openvpn/tun.c 3 files changed, 6 insertions(+), 10 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/65/865/1 diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 1113663..b594b09 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -1448,7 +1448,7 @@ while (server) { - for (int i = 0; i < server->addr_count; ++i) + for (size_t i = 0; i < server->addr_count; ++i) { if (server->addr[i].family == AF_INET) { diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index 234d590..4aeb613 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -3131,8 +3131,7 @@ int ascii2proto(const char *proto_name) { - int i; - for (i = 0; i < SIZE(proto_names); ++i) + for (size_t i = 0; i < SIZE(proto_names); ++i) { if (!strcmp(proto_name, proto_names[i].short_form)) { @@ -3145,8 +3144,7 @@ sa_family_t ascii2af(const char *proto_name) { - int i; - for (i = 0; i < SIZE(proto_names); ++i) + for (size_t i = 0; i < SIZE(proto_names); ++i) { if (!strcmp(proto_name, proto_names[i].short_form)) { @@ -3159,8 +3157,7 @@ const char * proto2ascii(int proto, sa_family_t af, bool display_form) { - unsigned int i; - for (i = 0; i < SIZE(proto_names); ++i) + for (size_t i = 0; i < SIZE(proto_names); ++i) { if (proto_names[i].proto_af == af && proto_names[i].proto == proto) { @@ -3182,9 +3179,8 @@ proto2ascii_all(struct gc_arena *gc) { struct buffer out = alloc_buf_gc(256, gc); - int i; - for (i = 0; i < SIZE(proto_names); ++i) + for (size_t i = 0; i < SIZE(proto_names); ++i) { if (i) { diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 3f2ec4a..22706f3 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -631,7 +631,7 @@ { struct gc_arena gc = gc_new(); struct route_gateway_info rgi; - const int needed = (RGI_ADDR_DEFINED|RGI_NETMASK_DEFINED); + const unsigned int needed = (RGI_ADDR_DEFINED|RGI_NETMASK_DEFINED); get_default_gateway(&rgi, ctx); if ((rgi.flags & needed) == needed)