This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: res_send() doesn't work with osquery enabled
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin-patches at cygwin dot com
- Date: Thu, 26 Aug 2010 18:38:12 +0200
- Subject: Re: res_send() doesn't work with osquery enabled
- References: <4e84197e3f02b0bbf6e190e78826148b.squirrel@pseudo.egg6.net>
- Reply-to: cygwin-patches at cygwin dot com
Pierre, would you mind to take a look?
On Aug 26 19:07, pseudo@egg6.net wrote:
> Currently res_init() checks for availability of the native windows
> function DnsQuery_A. If the function is found, it's preferred over the
> cygwin implementation and res_query is set up to use it.
> As DnsQuery_A finds the configured name servers itself, the current code
> assumes we can avoid loading the dns server list with GetNetworkParams().
>
> However, the assumption that everybody would use res_query is wrong. Some
> programs may use res_mkquery() and res_send() or may only read the list of
> servers from _res.nsaddr_list and send/receive the queries/replies
> themselves. res_send() also relies on nsaddr_list.
>
> The following patch makes get_dns_info() always try to populate
> nsaddr_list if empty. If resolv.conf exists and provides nameservers, they
> will be used as usual. Otherwise, GetNetworkParams() will be called to get
> the servers from the operating system.
>
> 2010-08-26 Rumen Stoyanov <pseudo@egg6.net>
>
> * libc/minires-os-if.c (get_dns_info): Always populate nsaddr_list
> if empty, regardless of the availability of os_query.
> * libc/minires.c (res_nsend): Make sure there is atleast one
> nameserver in nsaddr_list or return.
Thanks,
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat