summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-08-31 19:11:25 +0200
committerThomas Haller <thaller@redhat.com>2016-09-09 14:10:27 +0200
commitdd484729097642459b15e92dd0d7171796934aba (patch)
tree1fd9b31b9bf061a886894202f4e684bb80a537c1
parent2162a84c5fd191fe6de171412958473c0b6f4487 (diff)
downloadNetworkManager-dd484729097642459b15e92dd0d7171796934aba.tar.gz
device: only set use_tempaddr sysctl for non-assumed devices
and only if the activation stage is not about to fail hard.
-rw-r--r--src/devices/nm-device.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 927d12e76c..de20e18d14 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -6707,7 +6707,7 @@ act_stage3_ip6_config_start (NMDevice *self,
NMConnection *connection;
const char *method;
NMSettingIP6ConfigPrivacy ip6_privacy = NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN;
- const char *ip6_privacy_str = "0\n";
+ const char *ip6_privacy_str = "0";
GSList *slaves;
gboolean ready_slaves;
@@ -6803,19 +6803,22 @@ act_stage3_ip6_config_start (NMDevice *self,
/* Other methods (shared) aren't implemented yet */
- switch (ip6_privacy) {
- case NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN:
- case NM_SETTING_IP6_CONFIG_PRIVACY_DISABLED:
- ip6_privacy_str = "0";
- break;
- case NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_PUBLIC_ADDR:
- ip6_privacy_str = "1";
- break;
- case NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR:
- ip6_privacy_str = "2";
- break;
+ if ( ret != NM_ACT_STAGE_RETURN_FAILURE
+ && !nm_device_uses_assumed_connection (self)) {
+ switch (ip6_privacy) {
+ case NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN:
+ case NM_SETTING_IP6_CONFIG_PRIVACY_DISABLED:
+ ip6_privacy_str = "0";
+ break;
+ case NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_PUBLIC_ADDR:
+ ip6_privacy_str = "1";
+ break;
+ case NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR:
+ ip6_privacy_str = "2";
+ break;
+ }
+ nm_device_ipv6_sysctl_set (self, "use_tempaddr", ip6_privacy_str);
}
- nm_device_ipv6_sysctl_set (self, "use_tempaddr", ip6_privacy_str);
return ret;
}