mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-30 23:40:10 +01:00
ifcfg-rh: always reset ETHTOOL_WAKE_ON_LAN value
We must always set all variables, because othewise a previously set value might be merged into the new setting.
This commit is contained in:
parent
cd442112c6
commit
64e0e241c0
1 changed files with 7 additions and 5 deletions
|
|
@ -1171,11 +1171,12 @@ write_ethtool_setting (NMConnection *connection, shvarFile *ifcfg, GError **erro
|
|||
wol = nm_setting_wired_get_wake_on_lan (s_wired);
|
||||
wol_password = nm_setting_wired_get_wake_on_lan_password (s_wired);
|
||||
|
||||
if (wol == NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE)
|
||||
svSetValue (ifcfg, "ETHTOOL_WAKE_ON_LAN", "ignore");
|
||||
else if (wol == NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT) {
|
||||
/* pass */
|
||||
} else {
|
||||
svSetValue (ifcfg, "ETHTOOL_WAKE_ON_LAN",
|
||||
wol == NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE
|
||||
? "ignore"
|
||||
: NULL);
|
||||
if (!NM_IN_SET (wol, NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE,
|
||||
NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT)) {
|
||||
if (!str)
|
||||
str = g_string_sized_new (30);
|
||||
else
|
||||
|
|
@ -1202,6 +1203,7 @@ write_ethtool_setting (NMConnection *connection, shvarFile *ifcfg, GError **erro
|
|||
if (wol_password && NM_FLAGS_HAS (wol, NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC))
|
||||
g_string_append_printf (str, "s sopass %s", wol_password);
|
||||
}
|
||||
|
||||
if (str) {
|
||||
svSetValueStr (ifcfg, "ETHTOOL_OPTS", str->str);
|
||||
g_string_free (str, TRUE);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue