SFS's use of low-level DNS directly instead of using the libc name service also has another problem: SFS insists on using a nameserver that works with both TCP and UDP. libc is more tolerant.
My ISP provides nameservers that don't work with TCP. This is a failing of their, of course, it's not great, but it happens that it doesn't break anything else I've observed except SFS. This patch does not solve the bug, but at least it makes the DNS client more tolerant so that it will work with either UDP or TCP. -Phil
--- async/dns.C 2007/01/15 17:52:03 1.1 +++ async/dns.C 2007/01/15 18:00:04 @@ -223,7 +223,7 @@ last_resp = 0; last_bump = timenow; tcpsock = NULL; - } while (!udpinit () || !tcpinit ()); + } while (!(udpinit () || tcpinit ())); return resend (true, true); } @@ -237,14 +237,16 @@ } ptr<dnssock> sock; - if (!r->usetcp) - sock = udpsock; - else if (!tcpsock && !tcpinit ()) { - setsock (true); - return; + if (udpsock && (!tcpsock)) { + sock = udpsock; + } else if (tcpsock && (!udpsock)) { + sock = tcpsock; + } else if (tcpsock && udpsock) { + sock = r->usetcp ? tcpsock : udpsock; + } else { + setsock(true); + return; } - else - sock = tcpsock; u_char qb[QBSIZE]; int n;