Commit 7632a5e4 authored by ruslanvaliullin's avatar ruslanvaliullin Committed by Cesanta Bot

Fix ignoring DhcpNameServer

PUBLISHED_FROM=73d6767e4aaa7249eeb5d76f9e7160be041292ca
parent 7f20c41d
......@@ -10952,10 +10952,12 @@ static int mg_get_ip_address_of_nameserver(char *name, size_t name_len) {
break;
}
if (RegOpenKeyExW(hKey, subkey, 0, KEY_READ, &hSub) == ERROR_SUCCESS &&
(RegQueryValueExW(hSub, L"NameServer", 0, &type, (void *) value,
&len) == ERROR_SUCCESS ||
RegQueryValueExW(hSub, L"DhcpNameServer", 0, &type, (void *) value,
&len) == ERROR_SUCCESS)) {
((RegQueryValueExW(hSub, L"NameServer", 0, &type, (void *) value,
&len) == ERROR_SUCCESS &&
value[0] != '\0') ||
(RegQueryValueExW(hSub, L"DhcpNameServer", 0, &type, (void *) value,
&len) == ERROR_SUCCESS &&
value[0] != '\0'))) {
/*
* See https://github.com/cesanta/mongoose/issues/176
* The value taken from the registry can be empty, a single
......@@ -10964,9 +10966,6 @@ static int mg_get_ip_address_of_nameserver(char *name, size_t name_len) {
* If it's multiple IP addresses, take the first one.
*/
wchar_t *comma = wcschr(value, ',');
if (value[0] == '\0') {
continue;
}
if (comma != NULL) {
*comma = '\0';
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment