mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-09 08:18:03 +02:00
ifcfg-rh: preserve the archaic BOOTPROTO=static form
py-kickstart writes this out. Okay -- we don't care on read and it makes sense when there actually are addresses. https://bugzilla.redhat.com/show_bug.cgi?id=1445414
This commit is contained in:
parent
67fab76bf3
commit
38fbcdf0e5
1 changed files with 9 additions and 4 deletions
|
|
@ -2071,11 +2071,17 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
num = nm_setting_ip_config_get_num_addresses (s_ip4);
|
||||||
|
|
||||||
if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO))
|
if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO))
|
||||||
svSetValueStr (ifcfg, "BOOTPROTO", "dhcp");
|
svSetValueStr (ifcfg, "BOOTPROTO", "dhcp");
|
||||||
else if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_MANUAL))
|
else if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_MANUAL)) {
|
||||||
|
/* Preserve the archaic form of "static" if there actually
|
||||||
|
* is static configuration. */
|
||||||
|
if (g_strcmp0 (svGetValue (ifcfg, "BOOTPROTO", &tmp), "static") || !num)
|
||||||
svSetValueStr (ifcfg, "BOOTPROTO", "none");
|
svSetValueStr (ifcfg, "BOOTPROTO", "none");
|
||||||
else if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL))
|
g_free (tmp);
|
||||||
|
} else if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL))
|
||||||
svSetValueStr (ifcfg, "BOOTPROTO", "autoip");
|
svSetValueStr (ifcfg, "BOOTPROTO", "autoip");
|
||||||
else if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_SHARED))
|
else if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_SHARED))
|
||||||
svSetValueStr (ifcfg, "BOOTPROTO", "shared");
|
svSetValueStr (ifcfg, "BOOTPROTO", "shared");
|
||||||
|
|
@ -2094,7 +2100,6 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
|
||||||
/* Write out IPADDR<n>, PREFIX<n>, GATEWAY<n> for current IP addresses
|
/* Write out IPADDR<n>, PREFIX<n>, GATEWAY<n> for current IP addresses
|
||||||
* without labels. Unset obsolete NETMASK<n>.
|
* without labels. Unset obsolete NETMASK<n>.
|
||||||
*/
|
*/
|
||||||
num = nm_setting_ip_config_get_num_addresses (s_ip4);
|
|
||||||
for (i = n = 0; i < num; i++) {
|
for (i = n = 0; i < num; i++) {
|
||||||
NMIPAddress *addr;
|
NMIPAddress *addr;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue