summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-02-16 21:53:04 +0100
committerThomas Haller <thaller@redhat.com>2017-04-20 15:45:27 +0200
commitfaf1ffc5ccd94770250082e88885dcf1f70b43ac (patch)
tree72a9cf90e2f3faa030094f29d576d5bf40928e8b
parent369b323b2d8bbb72a6a3a571ebee29dc21acfa40 (diff)
downloadNetworkManager-faf1ffc5ccd94770250082e88885dcf1f70b43ac.tar.gz
ifcfg: ensure ipv4.method is not "disabled" when reading IP addresses from alias files
When the main ifcfg file contains no IP addresses, the method will be "disabled". Later, when reading IP addresses for the aliases, we must ensure that the method is manual. Otherwise, validation fails with ip.addresses: this property is not allowed for method=disabled (cherry picked from commit a8f0d88596d8dd2b807a7b0adee272c4f077dade) (cherry picked from commit be1daa4580267e448ad93b854da382026ea63281)
-rw-r--r--src/settings/plugins/ifcfg-rh/reader.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c
index 14abbae7c8..785aebb4e9 100644
--- a/src/settings/plugins/ifcfg-rh/reader.c
+++ b/src/settings/plugins/ifcfg-rh/reader.c
@@ -1294,6 +1294,8 @@ read_aliases (NMSettingIPConfig *s_ip4, const char *filename)
nm_ip_address_set_attribute (addr, "label", g_variant_new_string (device));
if (!nm_setting_ip_config_add_address (s_ip4, addr))
PARSE_WARNING ("duplicate IP4 address in alias file %s", item);
+ if (nm_streq0 (nm_setting_ip_config_get_method (s_ip4), NM_SETTING_IP4_CONFIG_METHOD_DISABLED))
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL, NULL);
} else {
PARSE_WARNING ("error reading IP4 address from alias file '%s': %s",
full_path, err ? err->message : "no address");