mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-09 04:48:10 +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(cherry picked from commitcf455aa0e2)
This commit is contained in:
parent
2757891b57
commit
4181f3c4f5
1 changed files with 6 additions and 2 deletions
|
|
@ -1135,10 +1135,11 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
|
|||
g_string_free (str, TRUE);
|
||||
}
|
||||
|
||||
svSetValue (ifcfg, "ETHTOOL_OPTS", NULL, FALSE);
|
||||
wol = nm_setting_wired_get_wake_on_lan (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);
|
||||
g_string_append (str, "wol ");
|
||||
|
||||
|
|
@ -1155,6 +1156,9 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
|
|||
if (NM_FLAGS_HAS (wol, NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC))
|
||||
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))
|
||||
g_string_append_printf (str, "s sopass %s", wol_password);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue