platform: fix handling secondary addresses during nm_platform_ip4_address_sync()

Although IFA_F_TEMPORARY is numerically equal to IFA_F_SECONDARY,
their meaning is different. One applies to IPv6 temporary addresses,
and the other to IPv4 secondary addresses.

During _addr_array_clean_expired() we want to ignore and clear
IPv6 temporary addresses, but not IPv4 secondary addresses.

Fixes: f2c4720bca
This commit is contained in:
Thomas Haller 2018-02-09 21:06:49 +01:00
parent 3e9e51f1dd
commit 0d53e093e6

View file

@ -3159,7 +3159,8 @@ _addr_array_clean_expired (int addr_family, int ifindex, GPtrArray *array, guint
}
#endif
if (NM_FLAGS_HAS (a->n_ifa_flags, IFA_F_TEMPORARY)) {
if ( addr_family == AF_INET6
&& NM_FLAGS_HAS (a->n_ifa_flags, IFA_F_TEMPORARY)) {
/* temporary addresses are never added explicitly by NetworkManager but
* kernel adds them via mngtempaddr flag.
*