From: "cron2 (Code Review)" Date: Thu, 19 Feb 2026 10:00:38 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="r3SeL6YmLeA="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[release/2.6]: dns: fix discards 'const' qualifier from pointer target type List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld , plaisthos Cc: openvpn-devel --r3SeL6YmLeA= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#3) to the change originally created by= flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1544?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by cron2 Change subject: dns: fix discards 'const' qualifier from pointer target type ...................................................................... dns: fix discards 'const' qualifier from pointer target type 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' quali= fier from pointer target type [-Wdiscarded-qualifiers] 67 | char *first_colon =3D strchr(addr, ':'); | ^~~~~~ src/openvpn/dns.c:68:24: warning: initialization discards 'const' quali= fier from pointer target type [-Wdiscarded-qualifiers] 68 | char *last_colon =3D strrchr(addr, ':'); | ^~~~~~~ Change-Id: I262705189edfbd9aa9a32bcd712840fffa592435 Signed-off-by: Rudi Heitbaum Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1542 Acked-by: Frank Lichtenheld Message-Id: <20260218214738.27158-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg35= 730.html Signed-off-by: Gert Doering (cherry picked from commit 0157e7fb8ae29b637537a6b98ce85217c6daf5a3) --- M src/openvpn/dns.c 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/44/1544/3 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 =3D 0; @@ -64,8 +64,8 @@ in_port_t port =3D 0; sa_family_t af; - char *first_colon =3D strchr(addr, ':'); - char *last_colon =3D strrchr(addr, ':'); + const char *first_colon =3D strchr(addr, ':'); + const char *last_colon =3D strrchr(addr, ':'); if (!first_colon || first_colon =3D=3D last_colon) { @@ -86,7 +86,7 @@ if (addr[0] =3D=3D '[') { addr +=3D 1; - char *bracket =3D last_colon - 1; + const char *bracket =3D last_colon - 1; if (*bracket !=3D ']' || bracket =3D=3D addr || !dns_server_po= rt_parse(&port, last_colon + 1)) { return false; -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1544?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newpatchset Gerrit-Project: openvpn Gerrit-Branch: release/2.6 Gerrit-Change-Id: I262705189edfbd9aa9a32bcd712840fffa592435 Gerrit-Change-Number: 1544 Gerrit-PatchSet: 3 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --r3SeL6YmLeA= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 upl= oaded patch set #3 to the change originally created by flichtenhel= d.

View Change

The following approvals got outdated and were remove= d: Code-Review+2 by cron2

dns: fix discards 'const' q=
ualifier from pointer target type

Since glibc-2.43:

For ISO C= 23, the functions bsearch, memchr, strchr, strpbrk, strrchr,
strstr, wcs= chr, wcspbrk, wcsrchr, wcsstr and wmemchr that return pointers
into thei= r 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-qu= alified type.

fixes:
src/openvpn/dns.c: In function 'dns_= server_addr_parse':
src/openvpn/dns.c:67:25: warning: initializa= tion discards 'const' qualifier from pointer target type [-Wdiscard= ed-qualifiers]
67 | char *first_colon =3D strchr(addr, ':= ');
| ^~~~~~
src/openvpn/dn= s.c:68:24: warning: initialization discards 'const' qualifier from = pointer target type [-Wdiscarded-qualifiers]
68 | char *last_= colon =3D strrchr(addr, ':');
| = ^~~~~~~

Change-Id: I262705189edfbd9aa9a32bcd712840fffa592435
Sig= ned-off-by: Rudi Heitbaum <rudi@...2993...>
Acked-by: Gert Doering= <gert@...1296...>
Gerrit URL: https://gerrit.openvpn.net/c/openvp= n/+/1542
Acked-by: Frank Lichtenheld <frank@...2641...>
Message= -Id: <20260218214738.27158-1-gert@...1296...>
URL: https://www.mai= l-archive.com/openvpn-devel@lists.sourceforge.net/msg35730.html
Signed-o= ff-by: Gert Doering <gert@...1296...>
(cherry picked from commit 0= 157e7fb8ae29b637537a6b98ce85217c6daf5a3)
---
M src/openvpn/dns.c
1= file changed, 4 insertions(+), 4 deletions(-)

g=
it pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/44/1544/3
=
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 @@
<= span> * @return True if parsing was successful
*/
static bool
-dns_server_port_parse(in_port_t *port, char *port_str)=
+dns_server_port_parse(in_p= ort_t *port, const char *port_str)
{
= char *endptr;
errno =3D 0;
@@ -64,8 +6= 4,8 @@
in_port_t port =3D 0;
sa_f= amily_t af;

- char *first_colon =3D strchr(addr, ':');
- char *last_colon =3D strrchr(add= r, ':');
+ = const char *first_colon =3D strchr(addr, ':');
+ const char *last_colon =3D strrchr(= addr, ':');

if (!first_colon= || first_colon =3D=3D last_colon)
{
@= @ -86,7 +86,7 @@
if (addr[0] =3D=3D '[')
{
addr +=3D 1;<= br>- char *bracket =3D= last_colon - 1;
+ = const char *bracket =3D last_colon - 1;
= if (*bracket !=3D ']' || bracket =3D=3D addr || !dns_server_port= _parse(&port, last_colon + 1))
{ return false;

T= o view, visit change 1544. To unsubscribe, or for help writing mail filters, vi= sit settings= .

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: I262705189edfbd9aa9a32bcd712= 840fffa592435
Gerrit-Change-Number: 1544
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --r3SeL6YmLeA=--