summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@rhel6-2.local>2016-12-16 16:15:47 +0100
committerLubomir Rintel <lkundrak@v3.sk>2016-12-19 14:20:19 +0100
commit0975f87b4fda868ecc3fb483c940e29dd729804b (patch)
tree20af489a5ca5fac6ae029af492c5411d3c3286aa
parentfa15543179aa8ca8e082267121e7df4a131bf642 (diff)
downloadNetworkManager-lr/ibft.tar.gz
ibft: pass the known addressing data along toolr/ibft
Even if they come from DHCP we need to assume they're static as the early boot firmware lost the rest of the lease data and they're about the only way we can match what initrd configured with what the boot firmware indicates. They're likely too precious to loose anyway, since getting a different one from DHCP would result in breakdown of the storage access.
-rw-r--r--src/settings/plugins/ibft/nms-ibft-reader.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/settings/plugins/ibft/nms-ibft-reader.c b/src/settings/plugins/ibft/nms-ibft-reader.c
index d26c833473..e1c64de895 100644
--- a/src/settings/plugins/ibft/nms-ibft-reader.c
+++ b/src/settings/plugins/ibft/nms-ibft-reader.c
@@ -292,17 +292,15 @@ ip4_setting_add_from_block (const GPtrArray *block,
if (!g_ascii_strcasecmp (s_method, "dhcp")) {
g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL);
- goto success;
- } else if (g_ascii_strcasecmp (s_method, "static") != 0) {
+ } else if (!g_ascii_strcasecmp (s_method, "static")) {
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL, NULL);
+ } else {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
"iBFT: malformed iscsiadm record: unknown " ISCSI_BOOTPROTO_TAG " '%s'.",
s_method);
goto error;
}
- /* Static configuration stuff */
- g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL, NULL);
-
/* IP address */
if (!s_ipaddr || !nm_utils_ipaddr_valid (AF_INET, s_ipaddr)) {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
@@ -357,7 +355,6 @@ ip4_setting_add_from_block (const GPtrArray *block,
if (s_dns2)
nm_setting_ip_config_add_dns (s_ip4, s_dns2);
-success:
nm_connection_add_setting (connection, NM_SETTING (s_ip4));
return TRUE;