When comparing DNS server configs, also compare number of servers
Bug: 16070602 Change-Id: I605f1cca50b08479ebcad290b3bd179f59be8a96
This commit is contained in:
parent
7efad83d43
commit
33a73bfa07
@ -1999,10 +1999,25 @@ _resolv_is_nameservers_equal_locked(struct resolv_cache_info* cache_info,
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char** ns;
|
char** ns;
|
||||||
|
int currentservers;
|
||||||
int equal = 1;
|
int equal = 1;
|
||||||
|
|
||||||
// compare each name server against current name servers
|
|
||||||
if (numservers > MAXNS) numservers = MAXNS;
|
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++) {
|
for (i = 0; i < numservers && equal; i++) {
|
||||||
ns = cache_info->nameservers;
|
ns = cache_info->nameservers;
|
||||||
equal = 0;
|
equal = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user