merge in lmp-release history after reset to 33a73bfa0712c483830e4c9abbf4d6a0551478bf
diff --git a/libc/dns/resolv/res_cache.c b/libc/dns/resolv/res_cache.c
index 419b748..d68ec3b 100644
--- a/libc/dns/resolv/res_cache.c
+++ b/libc/dns/resolv/res_cache.c
@@ -1999,10 +1999,25 @@
{
int i;
char** ns;
+ int currentservers;
int equal = 1;
- // compare each name server against current name servers
if (numservers > MAXNS) numservers = MAXNS;
+
+ // Find out how many nameservers we had before.
+ currentservers = 0;
+ for (ns = cache_info->nameservers; *ns; ns++)
+ currentservers++;
+
+ if (currentservers != numservers)
+ return 0;
+
+ // Compare each name server against current name servers.
+ // TODO: this is incorrect if the list of current or previous nameservers
+ // contains duplicates. This does not really matter because the framework
+ // filters out duplicates, but we should probably fix it. It's also
+ // insensitive to the order of the nameservers; we should probably fix that
+ // too.
for (i = 0; i < numservers && equal; i++) {
ns = cache_info->nameservers;
equal = 0;