platform: fix IPv4 secondary address detection

If the subnet index was built without the @full_index flag, secondary
addresses are not present in the hash table.

Fixes: 5fcca9ba3e
This commit is contained in:
Beniamino Galvani 2017-07-27 10:59:43 +02:00
parent 17ec3aef2f
commit 1dd4fec550

View file

@ -3091,7 +3091,7 @@ ip4_addr_subnets_build_index (const GPtrArray *addresses,
position = 0; /* prepend */
g_ptr_array_insert (addr_list, position, p_address);
} else {
/* we only care about the primay. No need to track the secondaries
/* we only care about the primary. No need to track the secondaries
* as a GPtrArray. */
nm_assert (ip4_addr_subnets_is_plain_address (addresses, p));
if ( consider_flags
@ -3142,8 +3142,8 @@ ip4_addr_subnets_is_secondary (const NMPObject *address,
if (*o != address)
return TRUE;
} else {
nm_assert (address == *((gconstpointer *) p));
NM_SET_OUT (out_addr_list, NULL);
return address != *((gconstpointer *) p);
}
return FALSE;
}