[Openvpn-devel,v1] iservice: fix DNS address list generation

Message ID 20251103115945.6615-1-gert@greenie.muc.de
State New
Headers show
Series [Openvpn-devel,v1] iservice: fix DNS address list generation | expand

Commit Message

Gert Doering Nov. 3, 2025, 11:59 a.m. UTC
From: Heiko Hund <heiko@ist.eigentlich.net>

While generating the address list string for the DNS server addresses,
to be set in the registry, the offset is calculated the wrong way. This
results in gaps between addresses after the first two.

Reported-By: aarnav@srlabs.de

Change-Id: I7252d5a252e91ffc03db142aa226c9eb1656480b
Signed-off-by: Heiko Hund <heiko@ist.eigentlich.net>
Acked-by: Lev Stipakov <lstipakov@gmail.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1339
---

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

Acked-by according to Gerrit (reflected above):
Lev Stipakov <lstipakov@gmail.com>

Comments

Gert Doering Nov. 3, 2025, 3:10 p.m. UTC | #1
Thanks.  Patch looks good, trivial enough :-) - the discussion about
the issue and the patch was in the private repo we have for possibly
security related issues (which this isn't, it will just effectively
ignore the 3rd and 4th nameserver IP).

Your patch has been applied to the master branch.

The bug is not in release/2.6 as it came in with the "use registry 
and no longer netsh" windows DNS rewrite for 2.7

commit 235aa8858b9999c14603ff1d12c91c855d5dcf94
Author: Heiko Hund
Date:   Mon Nov 3 12:59:40 2025 +0100

     iservice: fix DNS address list generation

     Signed-off-by: Heiko Hund <heiko@ist.eigentlich.net>
     Acked-by: Lev Stipakov <lstipakov@gmail.com>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1339
     Message-Id: <20251103115945.6615-1-gert@greenie.muc.de>
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c
index 577d89c..58f1e02 100644
--- a/src/openvpnserv/interactive.c
+++ b/src/openvpnserv/interactive.c
@@ -1873,7 +1873,7 @@ 
             {
                 RtlIpv4AddressToStringA(&msg->addr[i].ipv4, addrs + offset);
             }
-            offset += strlen(addrs);
+            offset = strlen(addrs);
         }
 
         err = SetNameServers(iid, msg->family, addrs);