device: only check for IPv6 DAD and link-local address on actively managed devices

In device_ipx_changed() we only keep track of dad6_failed_addrs
addresses if the device's state is > DISCONNECTED.

For the same reason, we should also do that in queued_ip_config_change().

But it's worse. If the device is in state disconnected, and the user
externally adds IPv6 addresses, we will end up in queued_ip_config_change().
It is easily possible that "need_ipv6ll" ends up being TRUE, which results
in a call to check_and_add_ipv6ll_addr() and later possibly

  ip_config_merge_and_apply (self, AF_INET6, TRUE);

This in turn will modify the IP configuration on the device, although
the device may be externally managed and NetworkManager shouldn't touch it.

https://bugzilla.redhat.com/show_bug.cgi?id=1593210
(cherry picked from commit 890c748643)
This commit is contained in:
Thomas Haller
2018-06-20 13:23:51 +02:00
parent e7ea66eb1a
commit 1609344eda

View File

@@ -12266,7 +12266,9 @@ queued_ip_config_change (NMDevice *self, int addr_family)
dad6_failed_addrs = g_steal_pointer (&priv->dad6_failed_addrs);
if ( priv->state < NM_DEVICE_STATE_DEACTIVATING
if ( priv->state > NM_DEVICE_STATE_DISCONNECTED
&& priv->state < NM_DEVICE_STATE_DEACTIVATING
&& !nm_device_sys_iface_state_is_external (self)
&& (platform = nm_device_get_platform (self))
&& nm_platform_link_get (platform, priv->ifindex)) {
gboolean need_ipv6ll = FALSE;