Don't flush the per-netid cache when adding nameservers.
This wasn't really necessary in the >= Lollipop architecture.
Test: netd_integration_test fails (fixing separately)
Bug: 32517984
Change-Id: I8115bfe913ae6609f64b55161a1c8e28ce2619cf
diff --git a/libc/dns/resolv/res_cache.c b/libc/dns/resolv/res_cache.c
index ad2c5c0..4c929f0 100644
--- a/libc/dns/resolv/res_cache.c
+++ b/libc/dns/resolv/res_cache.c
@@ -2010,8 +2010,8 @@
}
cache_info->nscount = numservers;
- // Flush the cache and reset the stats.
- _flush_cache_for_net_locked(netid);
+ // Clear the NS statistics because the mapping to nameservers might have changed.
+ _res_cache_clear_stats_locked(cache_info);
// increment the revision id to ensure that sample state is not written back if the
// servers change; in theory it would suffice to do so only if the servers or