From: Razvan Cojocaru <[email protected]>

The RegGetValueA() result for DhcpNameServer was discarded and the
error from the earlier NameServer lookup was tested instead. With no
NameServer value, err was still ERROR_FILE_NOT_FOUND, so the DHCP
fallback always failed.

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

Change-Id: I9eb4b74b53d680c160b8ac65ab844f6404431e62
Signed-off-by: Razvan Cojocaru <[email protected]>
Acked-by: Gert Doering <[email protected]>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2109
---

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

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

        
diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c
index 484f27c..4a8d0b5 100644
--- a/src/openvpnserv/interactive.c
+++ b/src/openvpnserv/interactive.c
@@ -2151,7 +2151,7 @@
     if (!strchr(addrs, '.') && IsDhcpEnabled(itf_key))
     {
         s = *size;
-        RegGetValueA(itf_key, NULL, "DhcpNameServer", RRF_RT_REG_SZ, NULL, 
(PBYTE)addrs, &s);
+        err = RegGetValueA(itf_key, NULL, "DhcpNameServer", RRF_RT_REG_SZ, 
NULL, (PBYTE)addrs, &s);
         if (err)
         {
             *size = 0;


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

Reply via email to