res_query() questions

Gernot Tenchio <[email protected]>
Newsgroups gmane.linux.lib.dietlibc
Organization TELCO TECH
Message-ID <[email protected]>
Hi,

I'm currently trying hard to understand the magic of dietlibc's
res_query(). But it seems that I'm completely lost in space. I've tried to
understand the case where 

 * WANT_PLUGPLAY_DNS is *un*set
 * WANT_IPV6_DNS is set

So here my results (and/or questions)

1:

 * the return value of __dns_make_fd()/__dns_make_fd6() isn't checked, so the
   following sendto() may operate on an invalid filedescriptor.
 * as a result of this operation sendto() returns -1 and res_query() fails
   with HOST_NOT_FOUND
 * any additional name servers listed in /etc/resolv.conf are ignored

2:

 * If sendto() succeeds, gettimeofday(last) is called but immediately after
   that, the result gets overwritten by "last=now"
 * Next, 'i' will be increased so we have the chance to ask the next
   name server.
 * After that we polling the current name server. If a timeout occurs after
   one second we continue.
 * The next sendto() will be performed only after 10 seconds, so we are
   polling the same name server again. This may be indented, but 'i' gets
   increased too.
 * So, it is undefined which name server will be asked after the mentioned 10
   seconds?

I'm completely confused. Maybe someone can enlighten me. I could try to fix
this to some extend but I have no idea what to do with all the PlugNPray
stuff.

Gernot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.