summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-01-30 22:31:37 +0100
committerThomas Haller <thaller@redhat.com>2016-01-30 22:38:57 +0100
commitadb07221fa0c4ee1dd29cd34e9899e6cd16b3875 (patch)
tree3f4c8b4636115bfc8c0c1eab085af2f23231697f
parent6d05d8882d6a8e18ffe302d84bed6baeeabfeb70 (diff)
downloadNetworkManager-th/device-ext-ip6-config-captured-bgo761371.tar.gz
device: check ext_ip6_config_captured for ll_addr in dhcp6_start_with_link_ready()th/device-ext-ip6-config-captured-bgo761371
We should not check ip6_config for the link local address because ip6_config contains the merged settings we want to configure, not the addresses that are actually configured on the device. Check ext_ip6_config_captured for that. Also, reuse nm_ip6_config_get_address_first_nontentative() which only takes an address after it survived DAD.
-rw-r--r--src/devices/nm-device.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 8a09a1330f..e40f654b6e 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -5283,9 +5283,7 @@ dhcp6_start_with_link_ready (NMDevice *self, NMConnection *connection)
GByteArray *tmp = NULL;
const guint8 *hw_addr;
size_t hw_addr_len = 0;
- const struct in6_addr *ll_addr = NULL;
- NMIP6Config *ip6_config;
- int i;
+ const NMPlatformIP6Address *ll_addr = NULL;
g_assert (connection);
s_ip6 = nm_connection_get_setting_ip6_config (connection);
@@ -5297,22 +5295,16 @@ dhcp6_start_with_link_ready (NMDevice *self, NMConnection *connection)
g_byte_array_append (tmp, hw_addr, hw_addr_len);
}
- ip6_config = priv->ip6_config;
- for (i = 0; ip6_config && i < nm_ip6_config_get_num_addresses (ip6_config); i++) {
- const NMPlatformIP6Address *addr = nm_ip6_config_get_address (ip6_config, i);
+ if (priv->ext_ip6_config_captured)
+ ll_addr = nm_ip6_config_get_address_first_nontentative (priv->ext_ip6_config_captured, TRUE);
- if (IN6_IS_ADDR_LINKLOCAL (&addr->address)) {
- ll_addr = &addr->address;
- break;
- }
- }
g_return_val_if_fail (ll_addr, FALSE);
priv->dhcp6_client = nm_dhcp_manager_start_ip6 (nm_dhcp_manager_get (),
nm_device_get_ip_iface (self),
nm_device_get_ip_ifindex (self),
tmp,
- ll_addr,
+ &ll_addr->address,
nm_connection_get_uuid (connection),
nm_device_get_ip6_route_metric (self),
nm_setting_ip_config_get_dhcp_send_hostname (s_ip6),