From patchwork Thu Aug 13 18:08:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5231 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:5508:b0:87d:ab56:3700 with SMTP id e8csp1222237mah; Thu, 13 Aug 2026 11:08:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AHgh+RozDU27ES/qZDiAlfQXrdEBwKHknz16nQxYif/2lQO8SuMrviJ4LXNlpmI/fAnvmqsDucH0BC9CB54=@openvpn.net X-Received: by 2002:a05:6808:2444:b0:4a3:95f3:68e with SMTP id 5614622812f47-4b227951ed6mr6194526b6e.9.1786644531531; Thu, 13 Aug 2026 11:08:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1786644531; cv=none; d=google.com; s=arc-20260327; b=RooxHUPkxzi9bP8XWdwtQHZxWNvH7ZPuQxg0xXjltHQ0kx99KDoiyfNP/onmDbBLgb KBcHTzmDWjsNOETCrUWtKkQXT62vC3yENtlZMFMdL8xBAuPy/BxEsEaw9q/pRLpNPrNn kV0XPeEEpznLiw8zLIA0i29xFvtU+ST8xtT7qAUpdVyPEbNtzomiPKXJBr32BmUbMpXR boeBjG/swRmSYSf+7V5ZWQIeguKMN5dVEunMotK7lAh6mQbxIEc1Jy7Qi8/EwGAqAB8L zMQ+94PTCrHZVurtiy7bGDI5OZ5yZppajWfIGiiZSVZa3gPxw9NoyfrXUbrSUhwmmM73 6Yvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; 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:dkim-signature; bh=EvQySc0Gkay47SIPi1BFY84I5VhQvcWCSqsFtw4IvJU=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=l93JhdGR0ObH+if/3apq2d8lV3NpHZVepi0/CR9iKLP4OMWQe8N+9WFd5eU4emcFjd U80A5IfozoNM2poPSWwt6E7kO+EQTyqV10eiWhYlZ0FkTVokE5SLuhhiM7vu2RCR5Pqo YX2wBtfwc5o4XeURYi1pMlhBoNe0ufxMpEhv43bPfUZ8/BI+SOjRaBF0Dzn2g0715/kb eDicjl9JjXGaT/3zfkIvmItvK0NKq+HEFcOHl9TinV3aYPglUEcmPOZp2j8xv7+oXgS9 AWjz9i1xD4Tyy6aiMZSsIf2U1bJRNrs7m0GiIFlEURgYbiIzOci5l+18hGTdpG2CKU9q UDHg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=MLGjDVUk; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Fu7+kV9O; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=cEU+iKeF; 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 5614622812f47-4b22d0e361csi4970780b6e.89.2026.08.13.11.08.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Aug 2026 11:08:51 -0700 (PDT) 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=pass header.i=@lists.sourceforge.net header.s=beta header.b=MLGjDVUk; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Fu7+kV9O; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=cEU+iKeF; 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 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=EvQySc0Gkay47SIPi1BFY84I5VhQvcWCSqsFtw4IvJU=; b=MLGjDVUkl97Al73yWbCrSH5bjf 1BGnEWzk5CMt0HFhr3HRct/JvtJxgHfh6n8mLRIou2f5JgzDXWEx1cNKQQ6+Ku/DIVnQAhJiG96zT YHwDpg6xuLWKBTwMWYjqLa3PKrf1yCMweoTeTPYq4O5PGBm/dT87JKO7BUSapaKzJtKM=; Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1wuZrE-0001Vc-EP; Thu, 13 Aug 2026 18:08:45 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1wuZrC-0001VV-Cd for openvpn-devel@lists.sourceforge.net; Thu, 13 Aug 2026 18:08:43 +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=QZd7Bjl1KLYGIZik6AGfJf2B325fr+G39U9i9zZLRLE=; b=Fu7+kV9O8E/0AmveQ4jlc1au8r KXcwOSi4V5DwFVfCAS6z3D6zqmxEZnvEoSQkJ2L+GvY0F+6O74yDDZENYz/tN2F2imAAR3IQKDePv D1DT2AEVSFEPMgZv3zNbOnyonRZE3WPAwgiDx5i1xMCt1bJZQE0ON8F33/BkU+sX+VjQ=; 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=QZd7Bjl1KLYGIZik6AGfJf2B325fr+G39U9i9zZLRLE=; b=cEU+iKeF+T+atU/9N95flA1Px0 C3DgxY9evQ7xQheJSeHTHV3o2bzcNmrgbiJNbVdPCFVcE5eSNgXwVbVgaLp54lSojwYWlh3rpdOju h+OiIpudPV4V1Vjh32ijGDYJKlnbxaIXqJKn+bS6ftNQbv/rUFthgAwAI42C4mMmx3ck=; Received: from [193.149.48.129] (helo=blue.greenie.muc.de) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1wuZrC-0001WS-2G for openvpn-devel@lists.sourceforge.net; Thu, 13 Aug 2026 18:08:43 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 67DI8ZZE003174 for ; Thu, 13 Aug 2026 20:08:35 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 67DI8Zlc003173 for openvpn-devel@lists.sourceforge.net; Thu, 13 Aug 2026 20:08:35 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Thu, 13 Aug 2026 20:08:29 +0200 Message-ID: <20260813180835.3160-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-1.hosts.colo.sdot.me", 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 Since we already check that the value is positive just make the implicit cast explicit. Change-Id: I2ca40d0d86599896b38ea1467313b6a6cdc8339c Signed-off-by: Frank Lichtenheld Acked-by: Razvan Cojocaru Gerrit URL: https://gerrit.openvpn.net/c/o [...] Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1wuZrC-0001WS-2G Subject: [Openvpn-devel] [PATCH v9] tun: Avoid sign-compare warning in header_modify_read_write_return 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: 1873432576221843921 X-GMAIL-MSGID: 1873432576221843921 From: Frank Lichtenheld Since we already check that the value is positive just make the implicit cast explicit. Change-Id: I2ca40d0d86599896b38ea1467313b6a6cdc8339c Signed-off-by: Frank Lichtenheld Acked-by: Razvan Cojocaru Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1527 --- 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/+/1527 This mail reflects revision 9 of this Change. Acked-by according to Gerrit (reflected above): Razvan Cojocaru diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index f46802f..28ec7b8 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -1706,17 +1706,12 @@ #include #include -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-compare" -#endif - static inline ssize_t header_modify_read_write_return(ssize_t len) { if (len > 0) { - return len > sizeof(u_int32_t) ? len - sizeof(u_int32_t) : 0; + return (size_t)len > sizeof(u_int32_t) ? len - sizeof(u_int32_t) : 0; } else { @@ -1724,10 +1719,6 @@ } } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - static ssize_t write_tun_header(struct tuntap *tt, uint8_t *buf, int len) {