From patchwork Mon Jan 19 12:25:51 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4717 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:9186:b0:80a:3855:ce6a with SMTP id j6csp3154910maf; Mon, 19 Jan 2026 04:26:17 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWGJ88pz+dAGksitJ0gEhl626rDrv9a1SKM/TJjoHu4uLoc3R0mtTIDSAD2eFRGVsPkx2c0Nc6giE4=@openvpn.net X-Received: by 2002:a05:6871:5f01:b0:3ec:6dff:3d3c with SMTP id 586e51a60fabf-4044c1af4e1mr6111434fac.14.1768825577418; Mon, 19 Jan 2026 04:26:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1768825577; cv=none; d=google.com; s=arc-20240605; b=VqjBI4PaX3td7oQkyYnE/2uVM+vgt/h/gi/5mvDm33u3ySiKTnFNCZP9GPbqQuo1es yMAhVTndwaNvX2Q7EIu/fYewKx1BFF6Bnbj8KAAk908UB04Z3aJTw+svMnDmCInKPY5r TQ+3ojprYdIopjloF8+sMQDAzd96oiw8QktRFe1bwfoB0l9QPzvxXr91e6Zm3Z3y/hHs 8TqgGeADgKO9LX/Cgv4ZH5BuMf/TziZZxaRp1+qercoO6nSd/nBMP00+MqrkJqdiC9lX Eu7qi8lwEMQeKMoxK3kqMvqRhOxpDbU9dm4qb2wAAeciUE5jwLt9P8zyldVQxPmOnhf2 8Iww== 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=IDYOnDg4cUmdnPW2ONUroVxTdi8ZlWguXzE4A8uzhAE=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=YQ4q4htzolv89SJfzd5MsIfXEFb7zTzN/049St+2v4/FlQ0ANSNiBhrUxUrhX/6BX5 91gdbwoYscD7KFaiszHjxiWECAgWWrXfvnPziVoym7bUbrpH0uHl3weyEjzebVUG/GCK N/6QDPheGo+DdHey3N++lh9IuBSl4Nri2IL5V7UuHmSqLAc2pn5RJR3EVxzV3N+saWyb YVU7/yUc1EEgi1tG8HADheQyFWklhP2iuujCqa87LOodqJL6OpEZhgSACGqTpZfKw/78 VrrABeSMcK0u1+jKYfTs7Hr+ttm6osRwChTHtCbWywFQNdD2Q7CL2Gm7t7H8Mw3qMRwX M50Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=daI8uC6K; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=FVg2B8oG; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Rl2ZPiLn; 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 586e51a60fabf-4044bb1b1b0si7339037fac.76.2026.01.19.04.26.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Jan 2026 04:26:17 -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=daI8uC6K; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=FVg2B8oG; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Rl2ZPiLn; 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=IDYOnDg4cUmdnPW2ONUroVxTdi8ZlWguXzE4A8uzhAE=; b=daI8uC6Ksu7hBVT9NC1fHILyyE YuahapMu+H/fKgxhq/LLIvuqdJnwYxzBtBYBSrd+vx6yspM0x0E46ji7tFq0QLrjWvtAPncIyIdOK DfRdOcEjqQ6sQ8s7McPm6WrLxmb6F0iiDO8iq1fKfY7AzOjyswtigo3FduEut3cBh7Pc=; 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 1vhoKi-0001rU-5v; Mon, 19 Jan 2026 12:26:12 +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 1vhoKh-0001rI-6Q for openvpn-devel@lists.sourceforge.net; Mon, 19 Jan 2026 12:26:11 +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=2h9zhJHXnkFyQ2JK/7rlnEn68gBu4JfhqWBUAVMBl10=; b=FVg2B8oG548FLvRpqTzKAMmB/A ceM0VUuW8yf1528pAa30DbSV7cXE9oJNSo3sVyBfd0PUhQGs/SKwRQUtp6oNlfyf63JPKLpRFaSUA 8Y+KLbLZREwlOX61gwEiq8Prwna3W+HumbqiEmGbIVcEmMZZ2hlpLODfi9Lu/D6rN/bA=; 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=2h9zhJHXnkFyQ2JK/7rlnEn68gBu4JfhqWBUAVMBl10=; b=Rl2ZPiLnDkLm8/+WKopQhDfyL0 w8bBSrmEyn8JSJ6KJr8gpf3Gf3Wn14ITHan7jm3to6PBjZgnJAzxQzKmWlnwyzH/QQ/m/J4eZkWBZ 6WG/yIa+vICBYJVRD6MxHPaQzwNlopfeZD6bueAGDmo3EZG6YfGdNuULOIcbBbM3nN5Q=; Received: from [193.149.48.134] (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 1vhoKh-000204-3D for openvpn-devel@lists.sourceforge.net; Mon, 19 Jan 2026 12:26:11 +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 60JCPxCv015245 for ; Mon, 19 Jan 2026 13:25:59 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 60JCPxoZ015244 for openvpn-devel@lists.sourceforge.net; Mon, 19 Jan 2026 13:25:59 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Mon, 19 Jan 2026 13:25:51 +0100 Message-ID: <20260119122556.15225-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.51.2 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 We already check earlier that bits is smaller that max_bits, so the cast is safe. While reviewing the callers, remove some unused variables. 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: 1vhoKh-000204-3D Subject: [Openvpn-devel] [PATCH v1] socket: Avoid conversion warning in get_addr_generic 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?1854748048445749408?= X-GMAIL-MSGID: =?utf-8?q?1854748048445749408?= From: Frank Lichtenheld We already check earlier that bits is smaller that max_bits, so the cast is safe. While reviewing the callers, remove some unused variables. Change-Id: I5ad13bc6674b3403251cc552d1f2c0f057431817 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1475 --- 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/+/1475 This mail reflects revision 1 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 cede758..85669e0 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -1144,10 +1144,7 @@ static bool ipv6_addr_safe_hexplusbits(const char *ipv6_prefix_spec) { - struct in6_addr t_addr; - unsigned int t_bits; - - return get_ipv6_addr(ipv6_prefix_spec, &t_addr, &t_bits, M_WARN); + return get_ipv6_addr(ipv6_prefix_spec, NULL, NULL, M_WARN); } static char * diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index 093f822..331249d 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -72,11 +72,6 @@ } } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - /* * Functions related to the translation of DNS names to IP addresses. */ @@ -180,7 +175,7 @@ if (netbits) { - *netbits = bits; + *netbits = (unsigned int)bits; } /* restore '/' separator, if any */ @@ -683,6 +678,11 @@ } } +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + static void create_socket(struct link_socket *sock, struct addrinfo *addr) { @@ -738,6 +738,10 @@ bind_local(sock, addr->ai_family); } +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic pop +#endif + #ifdef TARGET_ANDROID static void protect_fd_nonlocal(int fd, const struct sockaddr *addr) @@ -861,10 +865,6 @@ gc_free(&gc); } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - static socket_descriptor_t socket_listen_accept(socket_descriptor_t sd, struct link_socket_actual *act, const struct addrinfo *local, bool do_listen,