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
(cherry picked from commit 6771f836ce)
This commit is contained in:
Lubomir Rintel 2015-01-28 12:00:00 +01:00
parent da7a47a33e
commit cdf17af657
3 changed files with 6 additions and 5 deletions

View file

@ -375,7 +375,7 @@ nm_ip6_config_commit (const NMIP6Config *config, int ifindex)
g_return_val_if_fail (config != NULL, FALSE); g_return_val_if_fail (config != NULL, FALSE);
/* Addresses */ /* Addresses */
nm_platform_ip6_address_sync (ifindex, priv->addresses); nm_platform_ip6_address_sync (ifindex, priv->addresses, TRUE);
/* Routes */ /* Routes */
{ {

View file

@ -1826,6 +1826,7 @@ nm_platform_ip4_address_sync (int ifindex, const GArray *known_addresses, guint3
* nm_platform_ip6_address_sync: * nm_platform_ip6_address_sync:
* @ifindex: Interface index * @ifindex: Interface index
* @known_addresses: List of addresses * @known_addresses: List of addresses
* @keep_link_local: Don't remove link-local address
* *
* A convenience function to synchronize addresses for a specific interface * A convenience function to synchronize addresses for a specific interface
* with the least possible disturbance. It simply removes addresses that are * with the least possible disturbance. It simply removes addresses that are
@ -1834,7 +1835,7 @@ nm_platform_ip4_address_sync (int ifindex, const GArray *known_addresses, guint3
* Returns: %TRUE on success. * Returns: %TRUE on success.
*/ */
gboolean 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; GArray *addresses;
NMPlatformIP6Address *address; NMPlatformIP6Address *address;
@ -1847,7 +1848,7 @@ nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses)
address = &g_array_index (addresses, NMPlatformIP6Address, i); address = &g_array_index (addresses, NMPlatformIP6Address, i);
/* Leave link local address management to the kernel */ /* 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; continue;
if (!array_contains_ip6_address (known_addresses, address)) if (!array_contains_ip6_address (known_addresses, address))
@ -1880,7 +1881,7 @@ gboolean
nm_platform_address_flush (int ifindex) nm_platform_address_flush (int ifindex)
{ {
return nm_platform_ip4_address_sync (ifindex, NULL, 0) return nm_platform_ip4_address_sync (ifindex, NULL, 0)
&& nm_platform_ip6_address_sync (ifindex, NULL); && nm_platform_ip6_address_sync (ifindex, NULL, FALSE);
} }
/******************************************************************/ /******************************************************************/

View file

@ -572,7 +572,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_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_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_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_address_flush (int ifindex);
gboolean nm_platform_ip4_check_reinstall_device_route (int ifindex, const NMPlatformIP4Address *address, guint32 device_route_metric); gboolean nm_platform_ip4_check_reinstall_device_route (int ifindex, const NMPlatformIP4Address *address, guint32 device_route_metric);