mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 19:50:08 +01:00
device: cleanup completing wait for linklocal6
linklocal6_complete() had only one caller. The caller would check whether the conditions for linklocal6_complete() are satisfied, and then call it. Note that linklocal6_complete() would again assert that these conditions hold. Don't do this. Just move the check inside linklocal6_complete(), and rename to linklocal6_check_complete(). Also, linklocal6_complete() was called by update_ip_config(), which was called by nm_device_capture_initial_config() and queued_ip6_config_change(). It doesn't make sense to call linklocal6_complete() during nm_device_capture_initial_config(). Move the call to queued_ip6_config_change().
This commit is contained in:
parent
6cdf0b1820
commit
5fd82a2035
1 changed files with 22 additions and 21 deletions
|
|
@ -7420,17 +7420,24 @@ linklocal6_timeout_cb (gpointer user_data)
|
|||
}
|
||||
|
||||
static void
|
||||
linklocal6_complete (NMDevice *self)
|
||||
linklocal6_check_complete (NMDevice *self)
|
||||
{
|
||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
|
||||
NMConnection *connection;
|
||||
const char *method;
|
||||
|
||||
nm_assert (priv->linklocal6_timeout_id);
|
||||
nm_assert (priv->ext_ip6_config_captured);
|
||||
nm_assert (nm_ip6_config_find_first_address (priv->ext_ip6_config_captured,
|
||||
NM_PLATFORM_MATCH_WITH_ADDRTYPE_LINKLOCAL
|
||||
| NM_PLATFORM_MATCH_WITH_ADDRSTATE_NORMAL));
|
||||
if (!priv->linklocal6_timeout_id) {
|
||||
/* we are not waiting for linklocal to complete. Nothing to do. */
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !priv->ext_ip6_config_captured
|
||||
|| !nm_ip6_config_find_first_address (priv->ext_ip6_config_captured,
|
||||
NM_PLATFORM_MATCH_WITH_ADDRTYPE_LINKLOCAL
|
||||
| NM_PLATFORM_MATCH_WITH_ADDRSTATE_NORMAL)) {
|
||||
/* we don't have a non-tentative link local address yet. Wait longer. */
|
||||
return;
|
||||
}
|
||||
|
||||
nm_clear_g_source (&priv->linklocal6_timeout_id);
|
||||
|
||||
|
|
@ -11542,18 +11549,6 @@ update_ip_config (NMDevice *self, int addr_family, gboolean initial)
|
|||
ip6_config_merge_and_apply (self, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
if ( addr_family == AF_INET6
|
||||
&& priv->linklocal6_timeout_id
|
||||
&& priv->ext_ip6_config_captured
|
||||
&& nm_ip6_config_find_first_address (priv->ext_ip6_config_captured,
|
||||
NM_PLATFORM_MATCH_WITH_ADDRTYPE_LINKLOCAL
|
||||
| NM_PLATFORM_MATCH_WITH_ADDRSTATE_NORMAL)) {
|
||||
/* linklocal6 is ready now, do the state transition... we are also
|
||||
* invoked as g_idle_add, so no problems with reentrance doing it now.
|
||||
*/
|
||||
linklocal6_complete (self);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -11620,7 +11615,7 @@ queued_ip6_config_change (gpointer user_data)
|
|||
|
||||
/* Wait for any queued state changes */
|
||||
if (priv->queued_state.id)
|
||||
return TRUE;
|
||||
return G_SOURCE_CONTINUE;
|
||||
|
||||
priv->queued_ip6_config_id = 0;
|
||||
|
||||
|
|
@ -11634,9 +11629,15 @@ queued_ip6_config_change (gpointer user_data)
|
|||
priv->queued_ip6_config_pending = FALSE;
|
||||
priv->queued_ip6_config_id = g_idle_add (queued_ip6_config_change, self);
|
||||
_LOGT (LOGD_DEVICE, "IP6 update was postponed");
|
||||
} else
|
||||
} else {
|
||||
update_ip_config (self, AF_INET6, FALSE);
|
||||
|
||||
/* Check whether we need to complete waiting for link-local.
|
||||
* We are also called from an idle handler, so no problem doing state transitions
|
||||
* now. */
|
||||
linklocal6_check_complete (self);
|
||||
}
|
||||
|
||||
if ( priv->state < NM_DEVICE_STATE_DEACTIVATING
|
||||
&& (platform = nm_device_get_platform (self))
|
||||
&& nm_platform_link_get (platform, priv->ifindex)) {
|
||||
|
|
@ -11694,7 +11695,7 @@ queued_ip6_config_change (gpointer user_data)
|
|||
|
||||
set_unmanaged_external_down (self, TRUE);
|
||||
|
||||
return FALSE;
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue