From patchwork Mon Mar 30 11:38:19 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4856 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:6c4a:b0:83c:d90d:321 with SMTP id c10csp1384850may; Mon, 30 Mar 2026 04:38:42 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWJcToezVYUGYYdySqPSKmjKczfzRawqfawKQScgkow8mPIx43XlxyPiRSkX3Lsr9Zl+6n7mmeZCJ4=@openvpn.net X-Received: by 2002:a05:6830:3809:b0:7d9:f582:cb6d with SMTP id 46e09a7af769-7d9fad8acd2mr6440949a34.6.1774870722196; Mon, 30 Mar 2026 04:38:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774870722; cv=none; d=google.com; s=arc-20240605; b=M0BjTYeMQTcX56prpulkDQhfgxRH/HOBVlk+ZltQS9Lm4F1qufSHD8otko/WN452eZ fal8x4ytskMshndKEnqeBNEd9nNtG5SCcTdRZtI02Uq+ypvVe6aDODQsmyU9EfP0aBJA btrWQuqrjx1XXSDhASaTSNUnOXilD09xIVON/r0JwVRKmBUY+/qAeKYtrIuL8VPaoJfH vQJlVD0ysW1Su9E2RwQLZ4LLXKrejXPFUbfi4K0kuRsQxALTy4E2JEGQDDEvluB8hjeO glIznvwqIxijNYESMMXBxPNYu8NTVQ5qayd7qscIoAbQm9xK+/sYHuqEpRfDEc3hhs1X d4tA== 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:dkim-signature; bh=8F96NatZl9Hj57EgB2DCZ93g2sQT17861K/lBKm0en4=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=Rz+GA6lE6xLlmpVf3/o9ADz9I05rzphkiNMEep+difPfETD8hh88ZB+LvICCCOCKBu 5pDCucDSa9dAgLa4gYyuJASqzXLYjMFDWBgOYR2aWNl4DyoPBORdyqB9V/xUg06gfjAZ uj7LFm6NqpLAzdmleYtwNm0apVcZHafdMWWiB6MpsIsU8luFqNm1qcs9Rr+hH+frpYLv tfkBFFZ1S8mDfZFg3S7GHha9D4PuMcBo5hB4UHlvz9e57hKGDXq5MzN9KhQ2BP9zarqa lYo1lM01KR7YXI2F/FnPY1wMrYMagO6QChZCCHnScDqUx8bn6NS6KSm47jeS0Xp5+rYD Tfkg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=AMv+lnHB; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=fPQaOQRx; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=R1AZqKrD; 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-7da0a91ccabsi5476760a34.120.2026.03.30.04.38.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Mar 2026 04:38:42 -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=AMv+lnHB; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=fPQaOQRx; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=R1AZqKrD; 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=8F96NatZl9Hj57EgB2DCZ93g2sQT17861K/lBKm0en4=; b=AMv+lnHBGYCPKa5nDdRD1od9dC 9Lwxr3rpEMcbLWt0Mmd1IKU9ZM3O+rfCIlOSE8Zp5iGID6LtiUP5UWx10Qi1aIeNwtPE6UGugTRny YhfK4IYx3qkHGZCXIYf7pH1ja1tKfs33IlEZiXIRSh2JkWtjD491TzLrMs3tAz68ZWNE=; 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 1w7Ax4-0005II-TQ; Mon, 30 Mar 2026 11:38:38 +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 1w7Ax1-0005I0-NP for openvpn-devel@lists.sourceforge.net; Mon, 30 Mar 2026 11:38:35 +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=elJDuVt9m8rIOy98od94DNFm3vRRjdMdJ2JyhvC3vcY=; b=fPQaOQRxsg2KW9JNqeBqZHmcA1 ShxErWe9/xQJv/c+5KXH2eHHQpMHnP4S7oNSz11x9uwKtYv2zw2V0x0r/z95ydg/8FvixzniZKb0X uiG5c65gYZY5Oe1r1dRqlRgrVsike7WfwXyu9ZW+wH1anQwzrJtK4ouFo90qiOru8Ktg=; 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=elJDuVt9m8rIOy98od94DNFm3vRRjdMdJ2JyhvC3vcY=; b=R1AZqKrDDQaJBZF22MpBN79R1p F2Rl73x2b5oe0Rr011DRmYzZVST0tWuE60C9Dcc9MRcDutJG9JHsiZtDaETGYgbiTGwAJjKh4cSUe Q4YYORQO29j5uF0An4PsTouo75LEo+epMHuqhNF/s85hpt2uQb796xZn8cEMDmtoa0Bw=; Received: from [193.149.48.129] (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 1w7Awz-0000Iw-Mc for openvpn-devel@lists.sourceforge.net; Mon, 30 Mar 2026 11:38:34 +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 62UBcRts020071 for ; Mon, 30 Mar 2026 13:38:27 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 62UBcR9V020070 for openvpn-devel@lists.sourceforge.net; Mon, 30 Mar 2026 13:38:27 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Mon, 30 Mar 2026 13:38:19 +0200 Message-ID: <20260330113826.20057-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.52.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-2.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 FWP_E_ALREADY_EXISTS is explictly casted to HRESULT which is LONG. But Fwpm* return DWORD. So if you compare an expected result with the actual result you get an sign-compare warning... 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: 1w7Awz-0000Iw-Mc Subject: [Openvpn-devel] [PATCH v10] wfp_block: Avoid sign-compare warning with Fwpm* return types 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?1861086842370584762?= X-GMAIL-MSGID: =?utf-8?q?1861086842370584762?= From: Frank Lichtenheld FWP_E_ALREADY_EXISTS is explictly casted to HRESULT which is LONG. But Fwpm* return DWORD. So if you compare an expected result with the actual result you get an sign-compare warning... Change-Id: I2f6502da1832edcb273a0dfa9b3ef940bec2d711 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1506 --- 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/+/1506 This mail reflects revision 10 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/wfp_block.c b/src/openvpn/wfp_block.c index 74d19ce..4d38fdb 100644 --- a/src/openvpn/wfp_block.c +++ b/src/openvpn/wfp_block.c @@ -131,11 +131,6 @@ return err; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-compare" -#endif - /* * Block outgoing local traffic, possibly DNS only, except for * (i) adapter with the specified index (and loopback, if all is blocked) @@ -198,7 +193,7 @@ * do not treat "already exists" as an error */ err = add_sublayer(OPENVPN_WFP_BLOCK_SUBLAYER); - if (err == FWP_E_ALREADY_EXISTS || err == ERROR_SUCCESS) + if (err == (DWORD)FWP_E_ALREADY_EXISTS || err == ERROR_SUCCESS) { msg_handler(0, "WFP Block: Added a persistent sublayer with pre-defined UUID"); } @@ -345,10 +340,6 @@ return err; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - DWORD delete_wfp_block_filters(HANDLE engine_handle) {