diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2015-01-28 12:00:00 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2015-01-28 17:53:25 +0100 |
commit | 6771f836ce3518bc75f0cbbed74138f40c890f7d (patch) | |
tree | 98da4667c528821ea657f54b8486d3fb912a993b | |
parent | 8eba28b9bd07197070974fee103c89451a4cdf8e (diff) | |
download | NetworkManager-6771f836ce3518bc75f0cbbed74138f40c890f7d.tar.gz |
ip6-config: remove the link-local address on address flush
If it stays after device dispose a connection is assumed.
https://bugzilla.redhat.com/show_bug.cgi?id=1184997
-rw-r--r-- | src/nm-ip6-config.c | 2 | ||||
-rw-r--r-- | src/platform/nm-platform.c | 7 | ||||
-rw-r--r-- | src/platform/nm-platform.h | 2 |
3 files changed, 6 insertions, 5 deletions
diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c index abb35367ab..789523c155 100644 --- a/src/nm-ip6-config.c +++ b/src/nm-ip6-config.c @@ -375,7 +375,7 @@ nm_ip6_config_commit (const NMIP6Config *config, int ifindex) g_return_val_if_fail (config != NULL, FALSE); /* Addresses */ - nm_platform_ip6_address_sync (ifindex, priv->addresses); + nm_platform_ip6_address_sync (ifindex, priv->addresses, TRUE); /* Routes */ { diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c index 0540af8046..7d342e50bb 100644 --- a/src/platform/nm-platform.c +++ b/src/platform/nm-platform.c @@ -1867,6 +1867,7 @@ nm_platform_ip4_address_sync (int ifindex, const GArray *known_addresses, guint3 * nm_platform_ip6_address_sync: * @ifindex: Interface index * @known_addresses: List of addresses + * @keep_link_local: Don't remove link-local address * * A convenience function to synchronize addresses for a specific interface * with the least possible disturbance. It simply removes addresses that are @@ -1875,7 +1876,7 @@ nm_platform_ip4_address_sync (int ifindex, const GArray *known_addresses, guint3 * Returns: %TRUE on success. */ gboolean -nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses) +nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses, gboolean keep_link_local) { GArray *addresses; NMPlatformIP6Address *address; @@ -1888,7 +1889,7 @@ nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses) address = &g_array_index (addresses, NMPlatformIP6Address, i); /* Leave link local address management to the kernel */ - if (IN6_IS_ADDR_LINKLOCAL (&address->address)) + if (keep_link_local && IN6_IS_ADDR_LINKLOCAL (&address->address)) continue; if (!array_contains_ip6_address (known_addresses, address)) @@ -1921,7 +1922,7 @@ gboolean nm_platform_address_flush (int ifindex) { return nm_platform_ip4_address_sync (ifindex, NULL, 0) - && nm_platform_ip6_address_sync (ifindex, NULL); + && nm_platform_ip6_address_sync (ifindex, NULL, FALSE); } /******************************************************************/ diff --git a/src/platform/nm-platform.h b/src/platform/nm-platform.h index 52362e4398..6c093a3554 100644 --- a/src/platform/nm-platform.h +++ b/src/platform/nm-platform.h @@ -578,7 +578,7 @@ gboolean nm_platform_ip6_address_delete (int ifindex, struct in6_addr address, i gboolean nm_platform_ip4_address_exists (int ifindex, in_addr_t address, int plen); gboolean nm_platform_ip6_address_exists (int ifindex, struct in6_addr address, int plen); gboolean nm_platform_ip4_address_sync (int ifindex, const GArray *known_addresses, guint32 device_route_metric); -gboolean nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses); +gboolean nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses, gboolean keep_link_local); gboolean nm_platform_address_flush (int ifindex); gboolean nm_platform_ip4_check_reinstall_device_route (int ifindex, const NMPlatformIP4Address *address, guint32 device_route_metric); |