]> granicus.if.org Git - libevent/commitdiff
Load hosts file on Windows.
authorVilmos Nebehaj <v.nebehaj@gmail.com>
Fri, 21 Mar 2014 13:36:15 +0000 (14:36 +0100)
committerVilmos Nebehaj <v.nebehaj@gmail.com>
Fri, 21 Mar 2014 13:36:15 +0000 (14:36 +0100)
Hosts files are not loaded in evdns_base_config_windows_nameservers() if
load_nameservers_with_getnetworkparams() succeeds on Windows. Parse and
load it first before setting up nameservers.

evdns.c

diff --git a/evdns.c b/evdns.c
index 59c3abe18655ddd367d3421999e8a8b2e8264823..a143074d4aaa6dd6b4452d7d478ddf541a601c94 100644 (file)
--- a/evdns.c
+++ b/evdns.c
@@ -3826,17 +3826,18 @@ evdns_base_config_windows_nameservers(struct evdns_base *base)
        if (base == NULL)
                return -1;
        EVDNS_LOCK(base);
+       fname = evdns_get_default_hosts_filename();
+       log(EVDNS_LOG_DEBUG, "Loading hosts entries from %s", fname);
+       evdns_base_load_hosts(base, fname);
+       if (fname)
+               mm_free(fname);
+
        if (load_nameservers_with_getnetworkparams(base) == 0) {
                EVDNS_UNLOCK(base);
                return 0;
        }
        r = load_nameservers_from_registry(base);
 
-       fname = evdns_get_default_hosts_filename();
-       evdns_base_load_hosts(base, fname);
-       if (fname)
-               mm_free(fname);
-
        EVDNS_UNLOCK(base);
        return r;
 }