From patchwork Tue Jan 14 16:52:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4061 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:b7cb:b0:5e7:b9eb:58e8 with SMTP id en11csp2354244mab; Tue, 14 Jan 2025 08:52:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV8W7QMx9MYFaUzNBY6yxK/nOQCJaYyHPqWHzRovkrrWuU/NAnrz/sd9FKy6fybqeXqmMt5UkJxQcs=@openvpn.net X-Google-Smtp-Source: AGHT+IGlWqPgbY9Fj0hPqHvWxke+qu8SD0DaJeGEFAfMoHnmV9/68lgXED2uf3sSX994NyNhHgGj X-Received: by 2002:a05:6830:6315:b0:71d:e900:2322 with SMTP id 46e09a7af769-721e2e38889mr19115469a34.8.1736873539823; Tue, 14 Jan 2025 08:52:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736873539; cv=none; d=google.com; s=arc-20240605; b=bgmk8gCtstw0YaBfIT16PStbKmYv3Ok3le3nqzsQe8waA5K5Oma93tsaOTkLXFojl8 L+bLCqlWhjz8Ednnk1hoFpMKf7NGz8vBJFMnd4iCULuYFm+asmEuxQg1vngjvSVOIZQR pCeB1X/DvQWePjZveDK6tQXq0FxLbaFsXvuPRPGTOIcBVR5xNPVrwFxGH0a5xYbeGaRe X0+wuXk914fmySORc3hlMd9Np08aPSo5G4k1ZxPsgyNr8xVhQcQW5yiFfSYVQs94uN6L Fmje6kg/Gg1t+VhGMSN9Grc/pAGjRPOXrias4O+zH5SFfxDBrQhBAPYSH1CVYqfv/LwF m33w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature; bh=sBK41Zi9od4g8RNbleQKTlEO46+hFNE6o+ZHRmpXKSc=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=aEH1auTv0DY315hmLhiFWcgjmWIv3jHD8cAmGRJfm3D2CPkTguYd/tXtIz1jvhji8P el1ynlS6O6UdU1F30TDvbxz0QviiAtkBNBoZfP7t9kZz97W/Riysh50Szp3SUvQ/stzB 7BwBMa7wGShz2qwnr82TTcJwvqSeVrHp7GatQmEHKHwpWaYPbqfQS8Y9nZtxU11DGVAO Gjl0gjRB87B+Je3TvJl7Gn2eps5EpJ2JK5xyxg6AN8ACX0XtwGpzjTpHDBX+lG6o6X2d P9rTM8o5kT5jALOrdL/X4FlV235cc8sqwYnnCBMX+uCF1IX3p+lW2N4BT7UUQkAFzzxi XyvA==; 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=MTEGhwkb; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=QJB9vvhm; 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=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 46e09a7af769-723185606f9si8975278a34.111.2025.01.14.08.52.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Jan 2025 08:52:19 -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=MTEGhwkb; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=QJB9vvhm; 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=muc.de 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 1tXk9I-0007iT-Ol; Tue, 14 Jan 2025 16:52:16 +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 1tXk9H-0007iJ-4h for openvpn-devel@lists.sourceforge.net; Tue, 14 Jan 2025 16:52:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=dlRTrT1SQSu+1NQdTzh3Mtx9ca7byFntgo7OSNAcWW8=; b=MTEGhwkbw6U9cX+YRXt+cKw8/7 tL8VCr1Gq8r4rI5BBOtXAyYtaxYn110hz9gNh8Exr29AyqmNQIwYo8zQiXLi2taly/Si4Osh411VY fnJxqY3HhocXKzi29tOo7IR0Cn3Bv8+ihx/g1lElohxMLnQLBCeuRRgDUyZs1nK6RN9s=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=dlRTrT1SQSu+1NQdTzh3Mtx9ca7byFntgo7OSNAcWW8=; b=QJB9vvhmpYhn6YEv55eUX5RXTk rhLtY+YO7hHo95HVKQGO4MGMpkIb0b1t3OJJoDmwChV19COYNIlS+aNtnDkO19KxJC/nyMKEIbdoX s+IeP/PTJ9EHTbfN8a86iPumiLxmD11IR9Cr7ToLkuU5FX/ireV4Wk7EyfYBPGAUZY30=; Received: from dhcp-174.greenie.muc.de ([193.149.48.174] helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1tXk9G-0000qR-6Q for openvpn-devel@lists.sourceforge.net; Tue, 14 Jan 2025 16:52:15 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.17.1.9/8.17.1.9) with ESMTP id 50EGq7kY013197 for ; Tue, 14 Jan 2025 17:52:07 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 50EGq72m013196 for openvpn-devel@lists.sourceforge.net; Tue, 14 Jan 2025 17:52:07 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Tue, 14 Jan 2025 17:52:06 +0100 Message-ID: <20250114165206.13187-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 0.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: From: Frank Lichtenheld Change-Id: I1918c43202b87f0c987bfd9155c739da7dd02632 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering --- Content analysis details: (0.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 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. [193.149.48.174 listed in bl.score.senderscore.com] 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. [193.149.48.174 listed in sa-accredit.habeas.com] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1tXk9G-0000qR-6Q Subject: [Openvpn-devel] [PATCH v2] 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: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1821243908985017580?= X-GMAIL-MSGID: =?utf-8?q?1821243908985017580?= From: Frank Lichtenheld Change-Id: I1918c43202b87f0c987bfd9155c739da7dd02632 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/865 This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering 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)