Skip to contentSkip to conversation

Change in openvpn[master]: openvpnserv: fix inverted inet_ntop() check in GetItfDnsServersV6()

Openvpn-devel In review Răzvan Cojocaru (Code Review) via Openvpn-devel 3 participants 6 messages Nov 2 – Nov 3 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1793624563000.I97a14086258c08b47e37f07f103460a9d0bb9afd@gerrit.openvpn.net

#1 lore raw

Attention is currently required from: Arne Schwabe.

Hello Arne Schwabe,

I'd like you to do a code review.
Please visit

    https://gerrit.openvpn.net/c/openvpn/+/2090?usp=email

to review the following change.

Change subject: openvpnserv: fix inverted inet_ntop() check in GetItfDnsServersV6()
......................................................................

openvpnserv: fix inverted inet_ntop() check in GetItfDnsServersV6()

inet_ntop() returns NULL on failure, but the check treated success as an error, so DHCPv6 DNS servers were never returned.

Broken since 0f3b7d17 ("win: implement --dns option support with NRPT").

Change-Id I97a14086258c08b47e37f07f103460a9d0bb9afd

---
M src/openvpnserv/interactive.c

1 file changed, 1 insertion(+), 1 deletion(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/90/2090/1

src/openvpnserv/interactive.c +1 -1
index e2f17f0..484f27c 100644
@@ -2217,7 +2217,7 @@
                 s--;
             }
 
-            if (inet_ntop(AF_INET6, &in_addrs[i], pos, s) != NULL)
+            if (inet_ntop(AF_INET6, &in_addrs[i], pos, s) == NULL)
             {
                 *size = 0;
                 return ERROR_MORE_DATA;

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2090?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I97a14086258c08b47e37f07f103460a9d0bb9afd
Gerrit-Change-Number: 2090
Gerrit-PatchSet: 1
Gerrit-Owner: Răzvan Cojocaru <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: Arne Schwabe, Răzvan Cojocaru.

Frank Lichtenheld has posted comments on this change by Răzvan Cojocaru. ( https://gerrit.openvpn.net/c/openvpn/+/2090?usp=email )

Change subject: openvpnserv: fix inverted inet_ntop() check in GetItfDnsServersV6()
......................................................................

Patch Set 2: Code-Review+2

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2090?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I97a14086258c08b47e37f07f103460a9d0bb9afd
Gerrit-Change-Number: 2090
Gerrit-PatchSet: 2
Gerrit-Owner: Răzvan Cojocaru <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Frank Lichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Răzvan Cojocaru <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Comment-Date: Mon, 02 Nov 2026 17:02:14 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#3 lore raw

PATCH v2 1/1 openvpnserv: fix inverted inet_ntop() check in GetItfDnsServersV6()

In reply to a message not in the archive

From: Razvan Cojocaru <[email protected]>

inet_ntop() returns NULL on failure, but the check treated success as an error, so DHCPv6 DNS servers were never returned.

Broken since 0f3b7d17 ("win: implement --dns option support with NRPT").

Change-Id I97a14086258c08b47e37f07f103460a9d0bb9afd

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2090
---

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/+/2090
This mail reflects revision 2 of this Change.

Acked-by according to Gerrit (reflected above):
Frank Lichtenheld <[email protected]>

src/openvpnserv/interactive.c +1 -1
index e2f17f0..484f27c 100644
@@ -2217,7 +2217,7 @@
                 s--;
             }
 
-            if (inet_ntop(AF_INET6, &in_addrs[i], pos, s) != NULL)
+            if (inet_ntop(AF_INET6, &in_addrs[i], pos, s) == NULL)
             {
                 *size = 0;
                 return ERROR_MORE_DATA;

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Acked-by Frank Lichtenheld on v2 1/1
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: openvpnserv: fix inverted inet_ntop() check in GetItfDnsServersV6()

Our test coverage isn't good enough :-( - this is one that we should have seen ourselves... (some of the unix buildbots test --dns / --dhcp-option DNS,
but this is windows specific code). Lev, Heiko, are you listening?

Since this one is a bug that can break the regular path, it needs to go into 2.7. Compile-tested the 2.7 version on MinGW and GHA.

Your patch has been applied to the master and release/2.7 branch.

commit 09cc40a6ff9e1d81db463a7769c464dd2baecf1a (master) commit 542bf14970907c2a7d11890a09bc4209f02045ed (release/2.7)

Author: Razvan Cojocaru
Date:   Mon Nov 2 18:02:38 2026 +0100

openvpnserv: fix inverted inet_ntop() check in GetItfDnsServersV6()

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2090
Message-Id: <[email protected]>
URL: https://lore.kernel.org/openvpn-devel/[email protected]

--
kind regards,

Gert Doering

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#5 lore raw
In reply to a message not in the archive

Gert Doering has uploaded a new patch set (#3) to the change originally created by Răzvan Cojocaru. ( https://gerrit.openvpn.net/c/openvpn/+/2090?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by Frank Lichtenheld

Change subject: openvpnserv: fix inverted inet_ntop() check in GetItfDnsServersV6()
......................................................................

openvpnserv: fix inverted inet_ntop() check in GetItfDnsServersV6()

inet_ntop() returns NULL on failure, but the check treated success as an error, so DHCPv6 DNS servers were never returned.

Broken since 0f3b7d17 ("win: implement --dns option support with NRPT").

Change-Id I97a14086258c08b47e37f07f103460a9d0bb9afd

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2090
Message-Id: <[email protected]>
URL: https://lore.kernel.org/openvpn-devel/[email protected]

---
M src/openvpnserv/interactive.c

1 file changed, 1 insertion(+), 1 deletion(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/90/2090/3

src/openvpnserv/interactive.c +1 -1
index e2f17f0..484f27c 100644
@@ -2217,7 +2217,7 @@
                 s--;
             }
 
-            if (inet_ntop(AF_INET6, &in_addrs[i], pos, s) != NULL)
+            if (inet_ntop(AF_INET6, &in_addrs[i], pos, s) == NULL)
             {
                 *size = 0;
                 return ERROR_MORE_DATA;

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2090?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I97a14086258c08b47e37f07f103460a9d0bb9afd
Gerrit-Change-Number: 2090
Gerrit-PatchSet: 3
Gerrit-Owner: Răzvan Cojocaru <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Frank Lichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#6 lore raw
In reply to a message not in the archive

Gert Doering has submitted this change. ( https://gerrit.openvpn.net/c/openvpn/+/2090?usp=email )

Change subject: openvpnserv: fix inverted inet_ntop() check in GetItfDnsServersV6()
......................................................................

openvpnserv: fix inverted inet_ntop() check in GetItfDnsServersV6()

inet_ntop() returns NULL on failure, but the check treated success as an error, so DHCPv6 DNS servers were never returned.

Broken since 0f3b7d17 ("win: implement --dns option support with NRPT").

Change-Id I97a14086258c08b47e37f07f103460a9d0bb9afd

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2090
Message-Id: <[email protected]>
URL: https://lore.kernel.org/openvpn-devel/[email protected]

---
M src/openvpnserv/interactive.c

1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpnserv/interactive.c +1 -1
index e2f17f0..484f27c 100644
@@ -2217,7 +2217,7 @@
                 s--;
             }
 
-            if (inet_ntop(AF_INET6, &in_addrs[i], pos, s) != NULL)
+            if (inet_ntop(AF_INET6, &in_addrs[i], pos, s) == NULL)
             {
                 *size = 0;
                 return ERROR_MORE_DATA;

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2090?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I97a14086258c08b47e37f07f103460a9d0bb9afd
Gerrit-Change-Number: 2090
Gerrit-PatchSet: 3
Gerrit-Owner: Răzvan Cojocaru <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Frank Lichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel