summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-01-30 22:31:37 +0100
committerThomas Haller <thaller@redhat.com>2016-02-02 11:43:57 +0100
commit118a75fcde0ce0ee80d07fa6570f55e2e780895c (patch)
tree61fd7152b774d99b7701435b0fa1a395c434a574 /src
parent9ff161b2a1b0d4a63f91d326050ae1b8906b7b1b (diff)
downloadNetworkManager-118a75fcde0ce0ee80d07fa6570f55e2e780895c.tar.gz
device: check ext_ip6_config_captured for ll_addr in dhcp6_start_with_link_ready()
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.
Diffstat (limited to 'src')
-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 2a5ae8ad00..712c9d90e6 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -5284,9 +5284,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);
@@ -5298,22 +5296,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),