Currently a miss on a search-path entry is counted as a retry. This means that users with more than (num_nameservers * retries) entries in their search path list fail before trying all search paths. Concretely, a single nameserver with 4 search paths will never try the 4th search because the default retry is 3.
The code doesn't currently retry a given nameserver in case of an error, so retries is sort of meaningless (though there are some comments indicating it might come). This change only treats total failure of a nameserver (try next server) as a retry.
Signed-off-by: Tim Hockin thockin@google.com --- libc/inet/resolv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index 4b33896..e676f53 100644 --- a/libc/inet/resolv.c +++ b/libc/inet/resolv.c @@ -1320,7 +1320,6 @@ int __dns_lookup(const char *name, local_ns_num = last_ns_num; retries_left = __nameservers * __resolv_attempts; } - retries_left--; if (local_ns_num >= __nameservers) local_ns_num = 0; local_id++; @@ -1572,6 +1571,7 @@ int __dns_lookup(const char *name,
try_next_server: /* Try next nameserver */ + retries_left--; local_ns_num++; variant = -1; } while (retries_left > 0);
Hi Tim, Tim Hockin wrote,
Thanks for the patch. My git am fails, is the patch created againt uClibc-ng git master?
best regards Waldemar
yes, it was. Possible whitespace mangling? I don't have anything but gmail to send emails from my work address. It's a trivial patch, though, so maybe you can apply by hand?
On Mon, Feb 29, 2016 at 10:53 AM, Waldemar Brodkorb wbx@uclibc-ng.org wrote:
Hi Tim, Tim Hockin wrote,
Thanks for the patch. My git am fails, is the patch created againt uClibc-ng git master?
best regards Waldemar
Hi Tim, Tim Hockin wrote,
Currently a miss on a search-path entry is counted as a retry. This means that users with more than (num_nameservers * retries) entries in their search path list fail before trying all search paths. Concretely, a single nameserver with 4 search paths will never try the 4th search because the default retry is 3.
The code doesn't currently retry a given nameserver in case of an error, so retries is sort of meaningless (though there are some comments indicating it might come). This change only treats total failure of a nameserver (try next server) as a retry.
Signed-off-by: Tim Hockin thockin@google.com
Applied and included in 1.0.13,
I hope I got your patches right, as I needed to add them manually, git am failed.
Thanks Waldemar