diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2017-05-05 16:46:53 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2017-05-05 18:54:13 +0200 |
commit | 78b43f7ea17042675361ecf9cf9bc1c79c524e3c (patch) | |
tree | 108d7ede3166b2b8fd9cd0ec8031d00020bf47d8 | |
parent | ad35fbf3a33185e40a55245326dc22dbd499c90b (diff) | |
download | NetworkManager-78b43f7ea17042675361ecf9cf9bc1c79c524e3c.tar.gz |
device: synchronize IPv6 configuration in stage3
Most of the IPv6 methods require a non-tentative link local address
configured on the interface; we look at priv->ip6_config to determine
if such address exist. If the configuration is out-of-sync, we may
proceed with configuration when the link-local address does not exist
or is still tentative, especially because we toggle the "disable_ipv6"
sysctl parameter just before, which clears all IPv6 addresses on the
interface.
Ensure that priv->ip6_config is up-to-date before continuing with the
IPv6 configuration.
Fixes test: @ipv6_set_ra_announced_mtu
-rw-r--r-- | src/devices/nm-device.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 6c725f1be8..8c290af34c 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -531,6 +531,7 @@ static void realize_start_setup (NMDevice *self, static void _commit_mtu (NMDevice *self, const NMIP4Config *config); static void dhcp_schedule_restart (NMDevice *self, int family, const char *reason); static void _cancel_activation (NMDevice *self); +static void update_ip6_config (NMDevice *self, gboolean initial, gboolean check_ll); /*****************************************************************************/ @@ -7718,6 +7719,13 @@ act_stage3_ip6_config_start (NMDevice *self, /* Re-enable IPv6 on the interface */ set_disable_ipv6 (self, "0"); + /* Synchronize IPv6 configuration with kernel, since linklocal6_start() + * uses the information there to determine if we can proceed with the + * selected method (SLAAC, DHCP, link-local). + */ + nm_platform_process_events (nm_device_get_platform (self)); + update_ip6_config (self, FALSE, FALSE); + ip6_privacy = _ip6_privacy_get (self); if ( strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_AUTO) == 0 @@ -10649,7 +10657,7 @@ _ip6_config_subtract (gpointer value, gpointer user_data) } static void -update_ip6_config (NMDevice *self, gboolean initial) +update_ip6_config (NMDevice *self, gboolean initial, gboolean check_ll) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); int ifindex; @@ -10714,7 +10722,8 @@ update_ip6_config (NMDevice *self, gboolean initial) ip6_config_merge_and_apply (self, FALSE); } - if ( priv->linklocal6_timeout_id + if ( check_ll + && priv->linklocal6_timeout_id && priv->ext_ip6_config_captured && nm_ip6_config_get_address_first_nontentative (priv->ext_ip6_config_captured, TRUE)) { /* linklocal6 is ready now, do the state transition... we are also @@ -10728,7 +10737,7 @@ void nm_device_capture_initial_config (NMDevice *self) { update_ip4_config (self, TRUE); - update_ip6_config (self, TRUE); + update_ip6_config (self, TRUE, TRUE); } static gboolean @@ -10774,7 +10783,7 @@ queued_ip6_config_change (gpointer user_data) return TRUE; priv->queued_ip6_config_id = 0; - update_ip6_config (self, FALSE); + update_ip6_config (self, FALSE, TRUE); if (priv->state < NM_DEVICE_STATE_DEACTIVATING && nm_platform_link_get (nm_device_get_platform (self), priv->ifindex)) { |