summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-02-09 21:06:49 +0100
committerThomas Haller <thaller@redhat.com>2018-02-09 21:08:07 +0100
commit0d53e093e6a2c12ec28d04c239d5273d2aa76821 (patch)
tree6f0dadb5109d4415f58a99889d2348bf71644322
parent3e9e51f1dda8b142f63fa9eace77e02208fb5113 (diff)
downloadNetworkManager-0d53e093e6a2c12ec28d04c239d5273d2aa76821.tar.gz
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: f2c4720bcac1cf30babd77eb8b721e4e384fee8b
-rw-r--r--src/platform/nm-platform.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c
index e82c44bef4..572f1c48fd 100644
--- a/src/platform/nm-platform.c
+++ b/src/platform/nm-platform.c
@@ -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.
*