From patchwork Wed Feb 18 21:46:12 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4776 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:525e:b0:838:aef6:1aff with SMTP id e30csp393487mag; Wed, 18 Feb 2026 13:46:37 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVgrabhX8+x2viBV8Qtl+8rPy3QUsXVXTnTmMx/14FHGtEO9yBjYVI+so986RenIOgibSZgg5ABwIY=@openvpn.net X-Received: by 2002:a05:6870:f20a:b0:409:5c31:b6b3 with SMTP id 586e51a60fabf-40ef3b76e8cmr9155652fac.2.1771451197581; Wed, 18 Feb 2026 13:46:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1771451197; cv=none; d=google.com; s=arc-20240605; b=BLRhE2JwIRL4G+yVCutByIlBeKG+YcJjzV1SOTwkQSxewr1r8nAoAtkXdc7Ei/Rs6T IczMG63FDnStAhkIelHqM1ppSohYgo0nuX+z0qMFcLxJY5RQ7ZjGA15S5DkkwbkiF6Lv p06yrhnC1KC+lsVSI6CZZTGRaWF30CFGkUpyjrUMnoO2tOG3U8U7XYSakM85ScLSd3Ko Z+NKS2ZB859fGpEQ982RNkxBgZJZWQBh6f9xkYOe89Vdu69DnQUc6fzj2Nf+LwAjsm3N M2O75cd/1NOoBKczJ99r1xcN3vfvv+q+XUkXs4SdGjylHBlNadqnG2zyFzhK+UUC//Vp QsAw== 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=jogeQa9hsdGVLJklOqYO0EglsjffJfWr4O7u3KFOoTA=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=EkWj3vtW46iIr6MNBXhmzT4ZxjLT1brkz8/K0//f1R4NdvKLvQrHigRrdF6Fx0r3Vz Z1ZWbanIpRjLdlGt5raVfMiJjfHWDV/lXnDQVHav5EQGyJ9+/WTZy7dja3mRhv1+apYH HOdQHC6g4v/JVjfPxUO2fMniU0Uzau0HLGfEf28wBR3fucuDijk3qpNne9tO2u0/nT/o D7zHBj6flykp9Pg3UyBcliQyt/zvSW/NCjC/GGTb3ixb8izT5IAPa1EovoOLVIg/SW4+ yM7kovfJepSIuMbzjqOYaOpOP+AUZ/s2DK0iVU7c/pOwGsQ/VcKjjAFCcEHIuQZm9j9E mCLw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=HSDZhOEK; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=jtf0isbw; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=KktqgKIV; 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-40f0f9ad338si10739242fac.189.2026.02.18.13.46.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Feb 2026 13:46:37 -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=HSDZhOEK; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=jtf0isbw; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=KktqgKIV; 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=jogeQa9hsdGVLJklOqYO0EglsjffJfWr4O7u3KFOoTA=; b=HSDZhOEKqhv7oz4lM2EjNom9a2 RcfriHaDXg48IioL63P8PXMspgrEB+KtiMprkvbv7W7KZR3LPsj1t+RvA6X2WIcCQA26uQfrcgMwi ZQLEnZGTO8tbNsX6QkQoOYG9PB3fvxEUFnY9c32ztiAXfCLN6WqNMTtBc3JRPXr73FIg=; 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 1vspNQ-0002Zb-Vl; Wed, 18 Feb 2026 21:46:32 +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 1vspNP-0002VH-EV for openvpn-devel@lists.sourceforge.net; Wed, 18 Feb 2026 21:46:31 +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=3IAn6Ovb8Rjwn0Q7RvuNLqh9cRgpgLCMXySiX0RID4U=; b=jtf0isbwc/lBgS6IrTTQ1NkCuZ qUTA9ouQK6q/N83hfM+wgSDUiFephEKapvA1daFMhp57Gt+zYtqLu7NAXqqjp9tAg6S1blt2LG8RU XvOhoZ1Cw30rPHQFpWTEPMidrhi7BgmxeKWH6zGxU92rf/pOll2alQ9/6Giimza5txhc=; 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=3IAn6Ovb8Rjwn0Q7RvuNLqh9cRgpgLCMXySiX0RID4U=; b=KktqgKIVW6/0lAZQ8vaoUQYoyo 3gjiVUrWOYM3bOKuuRyPPdV/MyEW2UQeed1PDNtQkOsFC2EhcYHC+KrxCprnvy5WgXtdrdg0UmuPg Ds7H75HwNnKnCRxyLIgNwNc1+jPlNVT/HEl0jAysTC7qyZL4Wq3vG8XA2ePl40SXMr1Y=; 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 1vspNO-0008JT-LR for openvpn-devel@lists.sourceforge.net; Wed, 18 Feb 2026 21:46:31 +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 61ILkIHC027073 for ; Wed, 18 Feb 2026 22:46:19 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 61ILkIp9027072 for openvpn-devel@lists.sourceforge.net; Wed, 18 Feb 2026 22:46:18 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Wed, 18 Feb 2026 22:46:12 +0100 Message-ID: <20260218214618.27059-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: Rudi Heitbaum Since glibc-2.43: For ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr, strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return pointers into their input arrays now have definitions as macros 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: 1vspNO-0008JT-LR Subject: [Openvpn-devel] [PATCH v2] dns: fix discards 'const' qualifier from pointer target type 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?1857501211096124669?= X-GMAIL-MSGID: =?utf-8?q?1857501211096124669?= From: Rudi Heitbaum Since glibc-2.43: For ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr, strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return pointers into their input arrays now have definitions as macros that return a pointer to a const-qualified type when the input argument is a pointer to a const-qualified type. fixes: src/openvpn/dns.c: In function 'dns_server_addr_parse': src/openvpn/dns.c:67:25: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 67 | char *first_colon = strchr(addr, ':'); | ^~~~~~ src/openvpn/dns.c:68:24: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 68 | char *last_colon = strrchr(addr, ':'); | ^~~~~~~ Change-Id: I262705189edfbd9aa9a32bcd712840fffa592435 Signed-off-by: Rudi Heitbaum Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1544 (cherry picked from commit 157fd949aff80ae3fb5897045af3ec4c213e1b0f) --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to release/2.6. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1544 This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/dns.c b/src/openvpn/dns.c index 7de3991..66ac32f 100644 --- a/src/openvpn/dns.c +++ b/src/openvpn/dns.c @@ -38,7 +38,7 @@ * @return True if parsing was successful */ static bool -dns_server_port_parse(in_port_t *port, char *port_str) +dns_server_port_parse(in_port_t *port, const char *port_str) { char *endptr; errno = 0; @@ -64,8 +64,8 @@ in_port_t port = 0; sa_family_t af; - char *first_colon = strchr(addr, ':'); - char *last_colon = strrchr(addr, ':'); + const char *first_colon = strchr(addr, ':'); + const char *last_colon = strrchr(addr, ':'); if (!first_colon || first_colon == last_colon) { @@ -86,7 +86,7 @@ if (addr[0] == '[') { addr += 1; - char *bracket = last_colon - 1; + const char *bracket = last_colon - 1; if (*bracket != ']' || bracket == addr || !dns_server_port_parse(&port, last_colon + 1)) { return false;