mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 11:40:08 +01:00
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:
parent
da7a47a33e
commit
cdf17af657
3 changed files with 6 additions and 5 deletions
|
|
@ -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 */
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1826,6 +1826,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
|
||||
|
|
@ -1834,7 +1835,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;
|
||||
|
|
@ -1847,7 +1848,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))
|
||||
|
|
@ -1880,7 +1881,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);
|
||||
}
|
||||
|
||||
/******************************************************************/
|
||||
|
|
|
|||
|
|
@ -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_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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue