summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2015-03-16 19:06:04 +0100
committerLubomir Rintel <lkundrak@v3.sk>2015-03-17 16:46:33 +0100
commit59474540eaab31dcc428a9b542b5b734569caa71 (patch)
treefd684a844374d267196465cab95f67dec71eb41c
parenta8a9955d756838a8592162de86cde1149de1ca09 (diff)
downloadNetworkManager-lr/remove-race.tar.gz
device: if there's a ll address already don't re-commit itlr/remove-race
Configuration commit is an unsafe thing to do for assumed connections, it can remove an externally added address we don't know about yet. The device already has a link-local address; for an assumed connection it's the reason we assumed the method=link-local in the first place.
-rw-r--r--src/devices/nm-device-private.h3
-rw-r--r--src/devices/nm-device.c11
2 files changed, 9 insertions, 5 deletions
diff --git a/src/devices/nm-device-private.h b/src/devices/nm-device-private.h
index 65a9a71af4..1f781bbc05 100644
--- a/src/devices/nm-device-private.h
+++ b/src/devices/nm-device-private.h
@@ -33,7 +33,8 @@ enum NMActStageReturn {
NM_ACT_STAGE_RETURN_SUCCESS, /* Activation stage done */
NM_ACT_STAGE_RETURN_POSTPONE, /* Long-running operation in progress */
NM_ACT_STAGE_RETURN_WAIT, /* Not ready to start stage; wait */
- NM_ACT_STAGE_RETURN_STOP /* Activation stage done; nothing to do */
+ NM_ACT_STAGE_RETURN_STOP, /* Activation not wanted */
+ NM_ACT_STAGE_RETURN_FINISH /* Activation stage done; nothing to do */
};
#define NM_DEVICE_CAP_NONSTANDARD_CARRIER 0x80000000
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 6fb7ef20a9..99c5853c12 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -4035,7 +4035,7 @@ linklocal6_start (NMDevice *self)
linklocal6_cleanup (self);
if (have_ip6_address (priv->ip6_config, TRUE))
- return NM_ACT_STAGE_RETURN_SUCCESS;
+ return NM_ACT_STAGE_RETURN_FINISH;
connection = nm_device_get_connection (self);
g_assert (connection);
@@ -4402,7 +4402,7 @@ addrconf6_start (NMDevice *self, NMSettingIP6ConfigPrivacy use_tempaddr)
}
/* success; already have the LL address; kick off router discovery */
- g_assert (ret == NM_ACT_STAGE_RETURN_SUCCESS);
+ g_assert (ret == NM_ACT_STAGE_RETURN_SUCCESS || ret == NM_ACT_STAGE_RETURN_FINISH);
return addrconf6_start_with_link_ready (self);
}
@@ -4688,7 +4688,7 @@ act_stage3_ip6_config_start (NMDevice *self,
ret = NM_ACT_STAGE_RETURN_POSTPONE;
} else if (strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL) == 0) {
ret = linklocal6_start (self);
- if (ret == NM_ACT_STAGE_RETURN_SUCCESS) {
+ if (ret == NM_ACT_STAGE_RETURN_FINISH) {
/* New blank config; LL address is already in priv->ext_ip6_config */
*out_config = nm_ip6_config_new (nm_device_get_ip_ifindex (self));
g_assert (*out_config);
@@ -4795,8 +4795,11 @@ nm_device_activate_stage3_ip6_start (NMDevice *self)
nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason);
return FALSE;
} else if (ret == NM_ACT_STAGE_RETURN_STOP) {
- /* Early finish */
+ /* Activation not wanted */
priv->ip6_state = IP_FAIL;
+ } else if (ret == NM_ACT_STAGE_RETURN_FINISH) {
+ /* Early finish, nothing more to do */
+ priv->ip6_state = IP_DONE;
} else if (ret == NM_ACT_STAGE_RETURN_WAIT) {
/* Wait for something to try IP config again */
priv->ip6_state = IP_WAIT;