summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2016-10-13 13:39:30 +0000
committerLubomir Rintel <lkundrak@v3.sk>2016-11-09 17:23:32 +0100
commit611870347a26bd3ed1839064aedf34c22b37b74e (patch)
tree24f5c12cb94dc3daacd733ff8f8fee4e907da30b
parent63878566020b8dab0180f6b8000f521fd43ada53 (diff)
downloadNetworkManager-611870347a26bd3ed1839064aedf34c22b37b74e.tar.gz
ifcfg: add ability to save/restore ipv6.method=shared
We use IPV6_AUTOCONF=shared for this.
-rw-r--r--src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c8
-rw-r--r--src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c2
2 files changed, 6 insertions, 4 deletions
diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c
index c77a360477..978804f498 100644
--- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c
+++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c
@@ -1381,7 +1381,7 @@ make_ip6_setting (shvarFile *ifcfg,
char *route6_path = NULL;
gs_free char *dns_options_free = NULL;
const char *dns_options = NULL;
- gboolean ipv6init, ipv6forwarding, ipv6_autoconf, dhcp6 = FALSE;
+ gboolean ipv6init, ipv6forwarding, dhcp6 = FALSE;
char *method = NM_SETTING_IP6_CONFIG_METHOD_MANUAL;
char *ipv6addr, *ipv6addr_secondaries;
char **list = NULL, **iter;
@@ -1454,10 +1454,12 @@ make_ip6_setting (shvarFile *ifcfg,
method = NM_SETTING_IP6_CONFIG_METHOD_IGNORE; /* IPv6 is disabled */
else {
ipv6forwarding = svGetValueBoolean (ifcfg, "IPV6FORWARDING", FALSE);
- ipv6_autoconf = svGetValueBoolean (ifcfg, "IPV6_AUTOCONF", !ipv6forwarding);
+ str_value = svGetValueString (ifcfg, "IPV6_AUTOCONF");
dhcp6 = svGetValueBoolean (ifcfg, "DHCPV6C", FALSE);
- if (ipv6_autoconf)
+ if (!g_strcmp0 (str_value, "shared"))
+ method = NM_SETTING_IP6_CONFIG_METHOD_SHARED;
+ else if (svParseBoolean (str_value, !ipv6forwarding))
method = NM_SETTING_IP6_CONFIG_METHOD_AUTO;
else if (dhcp6)
method = NM_SETTING_IP6_CONFIG_METHOD_DHCP;
diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c
index d456f1a2a6..1696e1ad43 100644
--- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c
+++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c
@@ -2477,8 +2477,8 @@ write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
svUnsetValue (ifcfg, "DHCPV6C");
} else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_SHARED)) {
svSetValueString (ifcfg, "IPV6INIT", "yes");
+ svSetValueString (ifcfg, "IPV6_AUTOCONF", "shared");
svUnsetValue (ifcfg, "DHCPV6C");
- /* TODO */
}
/* Write out IP addresses */