From patchwork Tue Dec 1 20:38:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5833 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:6022:91c9:10b0:11b:d6c:f273 with SMTP id tl9-n1csp15309721lad; Tue, 1 Dec 2026 12:38:27 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErFiRLqMTAuyBKEA+D4Nifdeq8t90EFdTujoc/w4RKs376qzUPcTD6aHoZW+PFfMd7jULlxC4CrMzqA=@openvpn.net X-Received: by 2002:a05:6820:81e:b0:71b:b200:2697 with SMTP id 006d021491bc7-71bb20027acmr8528889eaf.24.1796157506972; Tue, 01 Dec 2026 12:38:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1796157506; cv=none; d=google.com; s=arc-20260327; b=adM+xvKmepZS8wc6uQHSoN7uwx338dAZPd8C701DlIs2s7AcFt5gkEtV6dOeJUGaKD PslBhuLeAkNEqd73B8r7RYkuGQsO9Kl9LZOEruDeU2C3SMmQBZ+BepoP7H9fjcdC0Nk3 NblYHCBR1+vruNkMGDf2wJRjIObzoVorma1CPb3dHeyfhpmbHiETH7eyEReYzw2rWZOv jr4jK0ddm/QqsLLb/Gnd28A19vG47AKWqAe/m2a/FCwnHTvoLv6xZ1cjmK8ARwVnoPXa 8wbayzE1+6suowG3kWEjM9F8V/H2ilyrkGwyjRJYyRX+YALW0XXBhrblbEUjndtBHfAt 1IZA== 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=4vHrPL684pSSklgcl4ZmKPgRyE3AeRqmZnGAtMx1A6o=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=V0m9vZevzNY/wp0yFzvZmwcWF79Dt4/iucWVmukgGgi4IrXwp2zUG3S5Bp/TKXBEJJ PnCv0ypxo+iQXyoDYzBlRYH94O+asLsh/gFtvWCq3XI0eJPlx2mCgop5hH0ck2INvA5F tFNvKbVlmocGcMf72M0lCjumwW0geGB9AsiHiKccrxHA29kiAZjDj/VZO1t8PswVlbcJ XdlgM57i+/WdClW9DIBrrxyVzub9dr1mzCEL+xz6CeRwvqK4FW3iY8sCG/yFGcx7TVgX CW16L50uOoazDILJzKhl8CWg+gCuJbxYkeawgifNRFD7UD1m0AFfMdGrOV4xY6eU2m77 /FXg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=QlY86xaQ; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=c40EB0BR; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Gyw80BOA; 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 006d021491bc7-71b37ff2deasi54202122eaf.7.2026.12.01.12.38.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Dec 2026 12:38:26 -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=pass header.i=@lists.sourceforge.net header.s=beta header.b=QlY86xaQ; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=c40EB0BR; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Gyw80BOA; 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-Unsubscribe-Post: List-Owner; bh=4vHrPL684pSSklgcl4ZmKPgRyE3AeRqmZnGAtMx1A6o=; b=QlY86xaQqh1aHW LEfICggQ3oq2ST5zLgzQCNlzXA2bzlEA4RDHJLiKsEHWJuGjRVnhasGECE+MEg8dJW8Ro9CB1/AEO 8wOpefcX14YR37Wq3pgMQiR7KvGeyDTnyb8ij4hxcgjmFgtfBvCDoS8vs4Y4MOZKidZOJ96eUxoZ3 IrE=; 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.100.1) (envelope-from ) id 1xYUcI-000000008Qj-20vt; Tue, 01 Dec 2026 20:38:22 +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.100.1) (envelope-from ) id 1xYUcG-000000008Qd-1Oxx for openvpn-devel@lists.sourceforge.net; Tue, 01 Dec 2026 20:38:20 +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-Unsubscribe-Post:List-Subscribe:List-Post:List-Owner:List-Archive; bh=cwylrgubEE+f7L+6JYEquZfiwMvIi9UBOKN3ULxqMXw=; b=c40EB0BRCS8ZWM1+Ipc0gf5cPV kOxk3HqRTIQ80Kjv4WyKWH5DQdJbp3YLxdjyqTqwqTIymT09Zh8h+VjgV7LkYxT2AOk0LkzVpEent jNcqxO381W9z/DJM2LFANJzFsoOKOHqwdJ5TNBBsv1zrkNn1hg9KWpcsaaO5ik/kh7bs=; 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-Unsubscribe-Post: List-Subscribe:List-Post:List-Owner:List-Archive; bh=cwylrgubEE+f7L+6JYEquZfiwMvIi9UBOKN3ULxqMXw=; b=Gyw80BOADzLqVgl6vGiMSLjOj/ Pp7m+JYWRDzC1SV4Ion2h9YAZCqdmVimSBCkkitINUbLkE1qvr3cvpU2lz/3nZ9uWSATThDwMhOLV cEHLh39Xg6DZqoUWRudcV4PnSfOnD5PkDcLvW80OtjjDtb560l2RZFO6o6ma91o9vu2g=; 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.100.1) id 1xYUcE-000000004PX-1yuG for openvpn-devel@lists.sourceforge.net; Tue, 01 Dec 2026 20:38:20 +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 6B1KcBrc004763 for ; Tue, 1 Dec 2026 21:38:11 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 6B1KcBF5004762 for openvpn-devel@lists.sourceforge.net; Tue, 1 Dec 2026 21:38:11 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Tue, 1 Dec 2026 21:38:06 +0100 Message-ID: <20261201203811.4743-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.55.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 - Mostly related to the annoying LSTATUS return value of Reg* functions. - Fixes one actual bug where get_reg_string could return ERROR_SUCCESS when ExpandEnvironmentStrings failed. But not sure how t [...] 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: 1xYUcE-000000004PX-1yuG Subject: [Openvpn-devel] [PATCH v2] tapctl: Fix sign conversion 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: 1883407653654563630 X-GMAIL-MSGID: 1883407653654563630 From: Frank Lichtenheld - Mostly related to the annoying LSTATUS return value of Reg* functions. - Fixes one actual bug where get_reg_string could return ERROR_SUCCESS when ExpandEnvironmentStrings failed. But not sure how to trigger that. Change-Id: I473c876cecffb4d057f6ffb23e50c3274de95989 Signed-off-by: Frank Lichtenheld Acked-by: Razvan Cojocaru Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2381 --- 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/+/2381 This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above): Razvan Cojocaru diff --git a/src/tapctl/tap.c b/src/tapctl/tap.c index 672bd2d..5aac7ff 100644 --- a/src/tapctl/tap.c +++ b/src/tapctl/tap.c @@ -102,11 +102,6 @@ } #endif -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-conversion" -#endif - /** * Returns length of string of strings * @@ -121,7 +116,7 @@ for (s = szz; s[0]; s += wcslen(s) + 1) { } - return s - szz; + return (size_t)(s - szz); } @@ -391,7 +386,7 @@ } DWORD dwValueType = REG_NONE, dwSize = 0; - DWORD dwResult = RegQueryValueEx(hKey, szName, NULL, &dwValueType, NULL, &dwSize); + DWORD dwResult = (DWORD)RegQueryValueEx(hKey, szName, NULL, &dwValueType, NULL, &dwSize); if (dwResult != ERROR_SUCCESS) { /* MSDN does not mention RegQueryValueEx() to set GetLastError(). But @@ -415,7 +410,7 @@ return ERROR_OUTOFMEMORY; } - dwResult = RegQueryValueEx(hKey, szName, NULL, NULL, (LPBYTE)szValue, &dwSize); + dwResult = (DWORD)RegQueryValueEx(hKey, szName, NULL, NULL, (LPBYTE)szValue, &dwSize); if (dwResult != ERROR_SUCCESS) { SetLastError(dwResult); @@ -441,6 +436,7 @@ DWORD dwCountExpResult = ExpandEnvironmentStrings(szValue, szValueExp, dwCountExp); if (dwCountExpResult == 0) { + dwResult = GetLastError(); msg(M_NONFATAL | M_ERRNO, "%s: expanding \"%ls\" registry value failed", __FUNCTION__, szName); free(szValueExp); @@ -533,7 +529,7 @@ /* Query the NetCfgInstanceId value. Using get_reg_string() right on might clutter the * output with error messages while the registry is still being populated. */ LPWSTR szCfgGuidString = NULL; - dwResult = RegQueryValueEx(hKey, L"NetCfgInstanceId", NULL, NULL, NULL, NULL); + dwResult = (DWORD)RegQueryValueEx(hKey, L"NetCfgInstanceId", NULL, NULL, NULL, NULL); if (dwResult != ERROR_SUCCESS) { if (dwResult == ERROR_FILE_NOT_FOUND && --iNumAttempts > 0) @@ -953,7 +949,7 @@ /* Open network adapter registry key. */ HKEY hKey = NULL; - dwResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szRegKey, 0, KEY_QUERY_VALUE, &hKey); + dwResult = (DWORD)RegOpenKeyEx(HKEY_LOCAL_MACHINE, szRegKey, 0, KEY_QUERY_VALUE, &hKey); if (dwResult != ERROR_SUCCESS) { SetLastError(dwResult); @@ -1120,7 +1116,7 @@ /* Open network adapter registry key. */ HKEY hKey = NULL; - dwResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szRegKey, 0, KEY_READ, &hKey); + dwResult = (DWORD)RegOpenKeyEx(HKEY_LOCAL_MACHINE, szRegKey, 0, KEY_READ, &hKey); if (dwResult != ERROR_SUCCESS) { SetLastError(dwResult); @@ -1185,10 +1181,6 @@ return dwResult; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - void tap_free_adapter_list(_In_ struct tap_adapter_node *pAdapterList) {