Store DNS server count in resolv_cache.
Instead of keeping a sentinel after nameservers[], nsaddrinfo[] and
nstats[], store the server count in the structure, freeing up memory and
eliminating the need to enumerate the server count every time
_resolv_is_nameservers_equal_locked() is invoked.
Also increase MAXNS from 3 to 4.
BUG: 28153323
Change-Id: I11a7257af695157c9e32019cd00c67b535b63c75
diff --git a/libc/dns/include/resolv_params.h b/libc/dns/include/resolv_params.h
index 353ae4d..f6948c0 100644
--- a/libc/dns/include/resolv_params.h
+++ b/libc/dns/include/resolv_params.h
@@ -20,11 +20,11 @@
#include <stdint.h>
/* Hard-coded defines */
-#define MAXNS 3 /* max # name servers we'll track */
+#define MAXNS 4 /* max # name servers we'll track */
#define MAXNSSAMPLES 64 /* max # samples to store per server */
/* Defaults used for initializing __res_params */
-#define SUCCESS_THRESHOLD 75 /* if successes * 100 / total_samples is less than
+#define SUCCESS_THRESHOLD 75 /* if successes * 100 / total_samples is less than
* this value, the server is considered failing
*/
#define NSSAMPLE_VALIDITY 1800 /* Sample validity in seconds.