cURL / Mailing Lists / curl-library / Single Mail


Re: ares "feature": Ignores responses from unexpected sources

From: Henrik Storner <>
Date: Thu, 16 Oct 2003 23:33:46 +0200

On Thu, Oct 16, 2003 at 05:15:07PM +0200, Daniel Stenberg wrote:
> On Wed, 8 Oct 2003, Henrik Storner wrote:
> > I have a DNS server that accepts queries on one IP-address, but sends the
> > answers with a different source-IP. A network trace says (IP's and
> > domain-names changed):
> >
> > -> DNS C Internet Addr ?
> > -> DNS R Internet Addr
> >
> > Note that the request is sent to, but the answer
> > originates from
> I would say this is a bug. At least it should timeout,
> If you're still able to repeat this "effect", can you dig into
> ares_process.c:process_answer() and see what it does to discard to response
> and possible how it can be patched?

I don't think ARES sees the response packet at all; it is probably
dropped by the OS/libc socket library. While browsing the ares source
code I noticed that it does a connect() on the socket used to
communicate with the DNS servers, even though it is a UDP SOCK_DGRAM
socket. My connect(2) man page says:

  If the socket is of type SOCK_DGRAM then the serv_addr address is the
  address to which datagrams are sent by default, and the only address
  from which datagrams are received.

Note that last sentence. So I guess it never sees the response

I'll try to figure out why it doesn't time out, then.

Henrik Storner <> 
This email is sponsored by: Giveback Program. hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here:
Received on 2003-10-17