Blame SOURCES/0006-rh1184997-ip6ll-flush.patch

386167
From cdf17af6579a6ddebc1a76affbfa756432bc6bfa Mon Sep 17 00:00:00 2001
386167
From: Lubomir Rintel <lkundrak@v3.sk>
386167
Date: Wed, 28 Jan 2015 12:00:00 +0100
386167
Subject: [PATCH] ip6-config: remove the link-local address on address flush
386167
386167
If it stays after device dispose a connection is assumed.
386167
386167
https://bugzilla.redhat.com/show_bug.cgi?id=1184997
386167
(cherry picked from commit 6771f836ce3518bc75f0cbbed74138f40c890f7d)
386167
---
386167
 src/nm-ip6-config.c        | 2 +-
386167
 src/platform/nm-platform.c | 7 ++++---
386167
 src/platform/nm-platform.h | 2 +-
386167
 3 files changed, 6 insertions(+), 5 deletions(-)
386167
386167
diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c
386167
index db64e72..63b4260 100644
386167
--- a/src/nm-ip6-config.c
386167
+++ b/src/nm-ip6-config.c
386167
@@ -375,7 +375,7 @@ nm_ip6_config_commit (const NMIP6Config *config, int ifindex)
386167
 	g_return_val_if_fail (config != NULL, FALSE);
386167
 
386167
 	/* Addresses */
386167
-	nm_platform_ip6_address_sync (ifindex, priv->addresses);
386167
+	nm_platform_ip6_address_sync (ifindex, priv->addresses, TRUE);
386167
 
386167
 	/* Routes */
386167
 	{
386167
diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c
386167
index 14fc44c..f679fe5 100644
386167
--- a/src/platform/nm-platform.c
386167
+++ b/src/platform/nm-platform.c
386167
@@ -1826,6 +1826,7 @@ nm_platform_ip4_address_sync (int ifindex, const GArray *known_addresses, guint3
386167
  * nm_platform_ip6_address_sync:
386167
  * @ifindex: Interface index
386167
  * @known_addresses: List of addresses
386167
+ * @keep_link_local: Don't remove link-local address
386167
  *
386167
  * A convenience function to synchronize addresses for a specific interface
386167
  * with the least possible disturbance. It simply removes addresses that are
386167
@@ -1834,7 +1835,7 @@ nm_platform_ip4_address_sync (int ifindex, const GArray *known_addresses, guint3
386167
  * Returns: %TRUE on success.
386167
  */
386167
 gboolean
386167
-nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses)
386167
+nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses, gboolean keep_link_local)
386167
 {
386167
 	GArray *addresses;
386167
 	NMPlatformIP6Address *address;
386167
@@ -1847,7 +1848,7 @@ nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses)
386167
 		address = &g_array_index (addresses, NMPlatformIP6Address, i);
386167
 
386167
 		/* Leave link local address management to the kernel */
386167
-		if (IN6_IS_ADDR_LINKLOCAL (&address->address))
386167
+		if (keep_link_local && IN6_IS_ADDR_LINKLOCAL (&address->address))
386167
 			continue;
386167
 
386167
 		if (!array_contains_ip6_address (known_addresses, address))
386167
@@ -1880,7 +1881,7 @@ gboolean
386167
 nm_platform_address_flush (int ifindex)
386167
 {
386167
 	return nm_platform_ip4_address_sync (ifindex, NULL, 0)
386167
-			&& nm_platform_ip6_address_sync (ifindex, NULL);
386167
+			&& nm_platform_ip6_address_sync (ifindex, NULL, FALSE);
386167
 }
386167
 
386167
 /******************************************************************/
386167
diff --git a/src/platform/nm-platform.h b/src/platform/nm-platform.h
386167
index 3f37ed6..62eb0f4 100644
386167
--- a/src/platform/nm-platform.h
386167
+++ b/src/platform/nm-platform.h
386167
@@ -572,7 +572,7 @@ gboolean nm_platform_ip6_address_delete (int ifindex, struct in6_addr address, i
386167
 gboolean nm_platform_ip4_address_exists (int ifindex, in_addr_t address, int plen);
386167
 gboolean nm_platform_ip6_address_exists (int ifindex, struct in6_addr address, int plen);
386167
 gboolean nm_platform_ip4_address_sync (int ifindex, const GArray *known_addresses, guint32 device_route_metric);
386167
-gboolean nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses);
386167
+gboolean nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses, gboolean keep_link_local);
386167
 gboolean nm_platform_address_flush (int ifindex);
386167
 
386167
 gboolean nm_platform_ip4_check_reinstall_device_route (int ifindex, const NMPlatformIP4Address *address, guint32 device_route_metric);
386167
-- 
386167
1.9.3
386167