ifcfg: enable writing/reading of speed and duplex when autoneg is enabled
This commit is contained in:
@@ -4174,8 +4174,8 @@ parse_ethtool_options (shvarFile *ifcfg, NMSettingWired *s_wired, const char *va
|
|||||||
NM_SETTING_WIRED_WAKE_ON_LAN, wol_flags,
|
NM_SETTING_WIRED_WAKE_ON_LAN, wol_flags,
|
||||||
NM_SETTING_WIRED_WAKE_ON_LAN_PASSWORD, ignore_wol_password ? NULL : wol_password,
|
NM_SETTING_WIRED_WAKE_ON_LAN_PASSWORD, ignore_wol_password ? NULL : wol_password,
|
||||||
NM_SETTING_WIRED_AUTO_NEGOTIATE, autoneg,
|
NM_SETTING_WIRED_AUTO_NEGOTIATE, autoneg,
|
||||||
NM_SETTING_WIRED_SPEED, autoneg ? 0 : speed,
|
NM_SETTING_WIRED_SPEED, speed,
|
||||||
NM_SETTING_WIRED_DUPLEX, autoneg ? NULL : duplex,
|
NM_SETTING_WIRED_DUPLEX, duplex,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1135,6 +1135,9 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
|
|||||||
/* Stuff ETHTOOL_OPT with required options */
|
/* Stuff ETHTOOL_OPT with required options */
|
||||||
str = NULL;
|
str = NULL;
|
||||||
auto_negotiate = nm_setting_wired_get_auto_negotiate (s_wired);
|
auto_negotiate = nm_setting_wired_get_auto_negotiate (s_wired);
|
||||||
|
speed = nm_setting_wired_get_speed (s_wired);
|
||||||
|
duplex = nm_setting_wired_get_duplex (s_wired);
|
||||||
|
|
||||||
/* autoneg off + speed 0 + duplex NULL, means we want NM
|
/* autoneg off + speed 0 + duplex NULL, means we want NM
|
||||||
* to skip link configuration which is default. So write
|
* to skip link configuration which is default. So write
|
||||||
* down link config only if we have auto-negotiate true or
|
* down link config only if we have auto-negotiate true or
|
||||||
@@ -1143,18 +1146,14 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
|
|||||||
if (auto_negotiate) {
|
if (auto_negotiate) {
|
||||||
str = g_string_sized_new (64);
|
str = g_string_sized_new (64);
|
||||||
g_string_printf (str, "autoneg on");
|
g_string_printf (str, "autoneg on");
|
||||||
} else {
|
} else if (speed || duplex) {
|
||||||
speed = nm_setting_wired_get_speed (s_wired);
|
str = g_string_sized_new (64);
|
||||||
duplex = nm_setting_wired_get_duplex (s_wired);
|
g_string_printf (str, "autoneg off");
|
||||||
if (speed || duplex) {
|
|
||||||
str = g_string_sized_new (64);
|
|
||||||
g_string_printf (str, "autoneg off");
|
|
||||||
if (speed)
|
|
||||||
g_string_append_printf (str, " speed %u", speed);
|
|
||||||
if (duplex)
|
|
||||||
g_string_append_printf (str, " duplex %s", duplex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if (speed)
|
||||||
|
g_string_append_printf (str, " speed %u", speed);
|
||||||
|
if (duplex)
|
||||||
|
g_string_append_printf (str, " duplex %s", duplex);
|
||||||
|
|
||||||
wol = nm_setting_wired_get_wake_on_lan (s_wired);
|
wol = nm_setting_wired_get_wake_on_lan (s_wired);
|
||||||
wol_password = nm_setting_wired_get_wake_on_lan_password (s_wired);
|
wol_password = nm_setting_wired_get_wake_on_lan_password (s_wired);
|
||||||
|
Reference in New Issue
Block a user