diff options
author | Dan Williams <dcbw@redhat.com> | 2014-08-13 14:44:22 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2014-08-13 14:44:22 -0500 |
commit | 3dd1ccae9be7ebd1ae29cd46f99d55e16eed2a45 (patch) | |
tree | f12e1fa46b0e6f0814b88c7c4623852bd5216791 | |
parent | c372090b2289a2d973c1e63e67e5147f9bd63332 (diff) | |
download | NetworkManager-dcbw/rh1101809-ipv6-timeout-static-fixes.tar.gz |
core: complete IPv6 even if RA times out when there are manual/external addressesdcbw/rh1101809-ipv6-timeout-static-fixes
Even if we never receive an RA, if there are manually-specified or external
addresses, consider IPv6 to complete successfully. No reason to fail IPv6
if we have IP configuration already, but RA doesn't respond. If RA shows
up again, we're still listening for it and will apply the config at that
time.
-rw-r--r-- | src/devices/nm-device.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 221619b7b0..a127ea6566 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -3296,9 +3296,9 @@ nm_device_dhcp6_renew (NMDevice *self, gboolean release) /******************************************/ static gboolean -linklocal6_config_is_ready (const NMIP6Config *ip6_config) +have_ip6_address (const NMIP6Config *ip6_config, gboolean linklocal) { - int i; + guint i; if (!ip6_config) return FALSE; @@ -3306,7 +3306,7 @@ linklocal6_config_is_ready (const NMIP6Config *ip6_config) for (i = 0; i < nm_ip6_config_get_num_addresses (ip6_config); i++) { const NMPlatformIP6Address *addr = nm_ip6_config_get_address (ip6_config, i); - if (IN6_IS_ADDR_LINKLOCAL (&addr->address) && + if ((IN6_IS_ADDR_LINKLOCAL (&addr->address) == linklocal) && !(addr->flags & IFA_F_TENTATIVE)) return TRUE; } @@ -3346,7 +3346,7 @@ linklocal6_complete (NMDevice *self) const char *method; g_assert (priv->linklocal6_timeout_id); - g_assert (linklocal6_config_is_ready (priv->ip6_config)); + g_assert (have_ip6_address (priv->ip6_config, TRUE)); linklocal6_cleanup (self); @@ -3377,7 +3377,7 @@ linklocal6_start (NMDevice *self) linklocal6_cleanup (self); - if (linklocal6_config_is_ready (priv->ip6_config)) + if (have_ip6_address (priv->ip6_config, TRUE)) return NM_ACT_STAGE_RETURN_SUCCESS; connection = nm_device_get_connection (self); @@ -3609,8 +3609,17 @@ rdisc_ra_timeout (NMRDisc *rdisc, NMDevice *self) */ _LOGD (LOGD_IP6, "timed out waiting for IPv6 router advertisement"); - if (priv->ip6_state == IP_CONF) - nm_device_activate_schedule_ip6_config_timeout (self); + if (priv->ip6_state == IP_CONF) { + /* If RA is our only source of addressing information and we don't + * ever receive one, then time out IPv6. But if there is other + * IPv6 configuration, like manual IPv6 addresses or external IPv6 + * config, consider that sufficient for IPv6 success. + */ + if (have_ip6_address (priv->ip6_config, FALSE)) + nm_device_activate_schedule_ip6_config_result (self); + else + nm_device_activate_schedule_ip6_config_timeout (self); + } } static gboolean @@ -5859,7 +5868,7 @@ update_ip_config (NMDevice *self, gboolean initial) /* Check this before modifying ext_ip6_config */ linklocal6_just_completed = priv->linklocal6_timeout_id && - linklocal6_config_is_ready (priv->ext_ip6_config); + have_ip6_address (priv->ext_ip6_config, TRUE); if (priv->ac_ip6_config) nm_ip6_config_subtract (priv->ext_ip6_config, priv->ac_ip6_config); |