mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 16:58:02 +02:00
ifcfg-rh: properly write the wake-on-lan property
ETHTOOL_OPTS must be cleared when the wake-on-lan value is 'default'
and a "wol d" string must be appended when the value is 'none'.
Fixes: 2e0d0bc050
This commit is contained in:
parent
e65854f609
commit
cf455aa0e2
1 changed files with 6 additions and 2 deletions
|
|
@ -1136,10 +1136,11 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
|
||||||
g_string_free (str, TRUE);
|
g_string_free (str, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
svSetValue (ifcfg, "ETHTOOL_OPTS", NULL, FALSE);
|
|
||||||
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);
|
||||||
if (wol) {
|
if (wol == NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT)
|
||||||
|
svSetValue (ifcfg, "ETHTOOL_OPTS", NULL, FALSE);
|
||||||
|
else {
|
||||||
str = g_string_sized_new (30);
|
str = g_string_sized_new (30);
|
||||||
g_string_append (str, "wol ");
|
g_string_append (str, "wol ");
|
||||||
|
|
||||||
|
|
@ -1156,6 +1157,9 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
|
||||||
if (NM_FLAGS_HAS (wol, NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC))
|
if (NM_FLAGS_HAS (wol, NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC))
|
||||||
g_string_append (str, "g");
|
g_string_append (str, "g");
|
||||||
|
|
||||||
|
if (!NM_FLAGS_ANY (wol, NM_SETTING_WIRED_WAKE_ON_LAN_ALL))
|
||||||
|
g_string_append (str, "d");
|
||||||
|
|
||||||
if (wol_password && NM_FLAGS_HAS (wol, NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC))
|
if (wol_password && NM_FLAGS_HAS (wol, NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC))
|
||||||
g_string_append_printf (str, "s sopass %s", wol_password);
|
g_string_append_printf (str, "s sopass %s", wol_password);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue