core: IPv6 mode link-local must not behave like auto (bgo#706618, bgo#707155)

In act_stage3_ip6_config_start, for IPv6 mode link-local, we check
if there is already an IPv6 address configured. If yes, we are
already done.

For now, as current workaround, if the LL does not exist, we
NM_ACT_STAGE_RETURN_STOP.

Later, we will POSTPONE and wait a timeout until we see a LL address
that is no longer TENTATIVE. The same should be done for method auto,
so that the device is usable to send router solitations (bgo#707155).

https://bugzilla.gnome.org/show_bug.cgi?id=707155
https://bugzilla.gnome.org/show_bug.cgi?id=706618

Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller 2013-11-07 20:38:08 +01:00
parent 03943e2854
commit 10bd060076

View file

@ -3206,6 +3206,31 @@ addrconf6_cleanup (NMDevice *self)
/******************************************/
static int
linklocal6_start (NMDevice *self)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
int i;
if (priv->ip6_config) {
for (i = 0; i < nm_ip6_config_get_num_addresses (priv->ip6_config); i++) {
const NMPlatformIP6Address *addr = nm_ip6_config_get_address (priv->ip6_config, i);
if (addr->plen == 128 && IN6_IS_ADDR_LINKLOCAL (&addr->address)) {
/* FIXME: only accept the address if it is no longer TENTATIVE */
return NM_ACT_STAGE_RETURN_SUCCESS;
}
}
}
/* FIXME: we should NM_ACT_STAGE_RETURN_POSTPONE and wait until with timeout
* we get a link local address that is no longer TENTATIVE. */
nm_log_warn (LOGD_DEVICE, "[%s] starting IPv6 with mode 'link-local', but the device has no link-local addresses configured.",
nm_device_get_iface (self));
return NM_ACT_STAGE_RETURN_STOP;
}
/* Get net.ipv6.conf.default.use_tempaddr value from /etc/sysctl.conf or
* /lib/sysctl.d/sysctl.conf
*/
@ -3317,13 +3342,14 @@ act_stage3_ip6_config_start (NMDevice *self,
priv->dhcp6_mode = NM_RDISC_DHCP_LEVEL_NONE;
if ( strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_AUTO) == 0
|| strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL) == 0) {
if ( strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_AUTO) == 0) {
if (!addrconf6_start (self)) {
/* IPv6 might be disabled; allow IPv4 to proceed */
ret = NM_ACT_STAGE_RETURN_STOP;
} else
ret = NM_ACT_STAGE_RETURN_POSTPONE;
} else if (strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL) == 0) {
ret = linklocal6_start (self);
} else if (strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_DHCP) == 0) {
/* Router advertisements shouldn't be used in pure DHCP mode */
if (priv->ip6_accept_ra_path)