ifcfg-rh: write all [ethernet] settings for write_wired_for_virtual()
It's not the task of the writer to mangle/normalize profiles. If a profile for a virtual device can have an [ethernet] setting, then unsuitable values like s390 options must be either rejected by nm_connection_verify() or normalized by nm_connection_normalize(). In no way it's right that the writer simple pretends they are not set.
This commit is contained in:
@@ -1096,7 +1096,6 @@ write_wired_setting_impl(NMSettingWired *s_wired, shvarFile *ifcfg, gboolean is_
|
|||||||
"GENERATE_MAC_ADDRESS_MASK",
|
"GENERATE_MAC_ADDRESS_MASK",
|
||||||
nm_setting_wired_get_generate_mac_address_mask(s_wired));
|
nm_setting_wired_get_generate_mac_address_mask(s_wired));
|
||||||
|
|
||||||
if (!is_virtual) {
|
|
||||||
macaddr_blacklist = nm_setting_wired_get_mac_address_blacklist(s_wired);
|
macaddr_blacklist = nm_setting_wired_get_mac_address_blacklist(s_wired);
|
||||||
if (macaddr_blacklist[0]) {
|
if (macaddr_blacklist[0]) {
|
||||||
gs_free char *blacklist_str = NULL;
|
gs_free char *blacklist_str = NULL;
|
||||||
@@ -1104,12 +1103,10 @@ write_wired_setting_impl(NMSettingWired *s_wired, shvarFile *ifcfg, gboolean is_
|
|||||||
blacklist_str = g_strjoinv(" ", (char **) macaddr_blacklist);
|
blacklist_str = g_strjoinv(" ", (char **) macaddr_blacklist);
|
||||||
svSetValueStr(ifcfg, "HWADDR_BLACKLIST", blacklist_str);
|
svSetValueStr(ifcfg, "HWADDR_BLACKLIST", blacklist_str);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
mtu = nm_setting_wired_get_mtu(s_wired);
|
mtu = nm_setting_wired_get_mtu(s_wired);
|
||||||
svSetValueInt64_cond(ifcfg, "MTU", mtu != 0, mtu);
|
svSetValueInt64_cond(ifcfg, "MTU", mtu != 0, mtu);
|
||||||
|
|
||||||
if (!is_virtual) {
|
|
||||||
s390_subchannels = nm_setting_wired_get_s390_subchannels(s_wired);
|
s390_subchannels = nm_setting_wired_get_s390_subchannels(s_wired);
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -1130,13 +1127,9 @@ write_wired_setting_impl(NMSettingWired *s_wired, shvarFile *ifcfg, gboolean is_
|
|||||||
|
|
||||||
svSetValueStr(ifcfg, "NETTYPE", nm_setting_wired_get_s390_nettype(s_wired));
|
svSetValueStr(ifcfg, "NETTYPE", nm_setting_wired_get_s390_nettype(s_wired));
|
||||||
|
|
||||||
svSetValueStr(ifcfg,
|
svSetValueStr(ifcfg, "PORTNAME", nm_setting_wired_get_s390_option_by_key(s_wired, "portname"));
|
||||||
"PORTNAME",
|
|
||||||
nm_setting_wired_get_s390_option_by_key(s_wired, "portname"));
|
|
||||||
|
|
||||||
svSetValueStr(ifcfg,
|
svSetValueStr(ifcfg, "CTCPROT", nm_setting_wired_get_s390_option_by_key(s_wired, "ctcprot"));
|
||||||
"CTCPROT",
|
|
||||||
nm_setting_wired_get_s390_option_by_key(s_wired, "ctcprot"));
|
|
||||||
|
|
||||||
num_opts = nm_setting_wired_get_num_s390_options(s_wired);
|
num_opts = nm_setting_wired_get_num_s390_options(s_wired);
|
||||||
if (s390_subchannels && num_opts) {
|
if (s390_subchannels && num_opts) {
|
||||||
@@ -1168,7 +1161,6 @@ write_wired_setting_impl(NMSettingWired *s_wired, shvarFile *ifcfg, gboolean is_
|
|||||||
if (tmp)
|
if (tmp)
|
||||||
svSetValueStr(ifcfg, "OPTIONS", tmp->str);
|
svSetValueStr(ifcfg, "OPTIONS", tmp->str);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!is_virtual)
|
if (!is_virtual)
|
||||||
svSetValueStr(ifcfg, "TYPE", TYPE_ETHERNET);
|
svSetValueStr(ifcfg, "TYPE", TYPE_ETHERNET);
|
||||||
|
Reference in New Issue
Block a user