summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-04-10 13:53:36 +0200
committerThomas Haller <thaller@redhat.com>2018-04-10 14:09:56 +0200
commitb50d7cc653fbc49a048f9b57d2b661a229ad4acc (patch)
tree6fd7663fd5526f9f8be15175db4f4157d3c313fa
parent69e80d6c51d9447445c8ef2696c8f3ef8c4d1dc9 (diff)
downloadNetworkManager-b50d7cc653fbc49a048f9b57d2b661a229ad4acc.tar.gz
platform: fix IPv6 address sync after for link local addresses
Since commit 78ed0a4a23f2e08cf5f3a4c75c67eba877c66494 (device: add IPv6 link local address via merge-and-apply) we handle also IPv6 link local addresses like regular addresses. That is, we also add them during merge-and-apply and sync them via nm_platform_ip6_address_sync(). ip6-address-sync loops over the platform addresses, to find which addresses shall be deleted, and which shall be deleted in order to fix the address order/priority. At that point, we must not ignore link-local addresses anymore, but handle them too. Otherwise, during each resync we have link local addresses, and platform-sync thinks that the address order is wrong. That wrongly leads to remove most addresses and re-adding them. Fixes: 78ed0a4a23f2e08cf5f3a4c75c67eba877c66494
-rw-r--r--src/platform/nm-platform.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c
index 976039def4..a5e2477a97 100644
--- a/src/platform/nm-platform.c
+++ b/src/platform/nm-platform.c
@@ -3652,8 +3652,11 @@ nm_platform_ip6_address_sync (NMPlatform *self,
* If we don't find a matching valid address in @known_addresses, we will delete
* plat_addr.
*
- * Certain addresses, like link-local or temporary addresses, are ignored by this function
- * if not run with full_sync.
+ * Certain addresses, like temporary addresses, are ignored by this function
+ * if not run with full_sync. These addresses are usually not managed by NetworkManager
+ * directly, or at least, they are not managed via nm_platform_ip6_address_sync().
+ * Only in full_sync mode, we really want to get rid of them (usually, when we take
+ * the interface down).
*
* Note that we mark handled addresses by setting it to %NULL in @plat_addresses array. */
for (i_plat = 0; i_plat < plat_addresses->len; i_plat++) {
@@ -3661,8 +3664,7 @@ nm_platform_ip6_address_sync (NMPlatform *self,
const NMPObject *know_obj;
const NMPlatformIP6Address *plat_addr = NMP_OBJECT_CAST_IP6_ADDRESS (plat_obj);
- if ( NM_FLAGS_HAS (plat_addr->n_ifa_flags, IFA_F_TEMPORARY)
- || IN6_IS_ADDR_LINKLOCAL (&plat_addr->address)) {
+ if (NM_FLAGS_HAS (plat_addr->n_ifa_flags, IFA_F_TEMPORARY)) {
if (!full_sync) {
/* just mark as handled, without actually deleting the address. */
goto clear_and_next;