diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2015-07-30 10:21:01 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2015-07-30 16:56:27 +0200 |
commit | cf455aa0e20f16b109a4cd4e76e26bb4f698d97e (patch) | |
tree | 4c362cc26093fcdb6cdd2d4444b046da41b77dba | |
parent | e65854f609dbf2e8f696fb217a468282e68b5e28 (diff) | |
download | NetworkManager-cf455aa0e20f16b109a4cd4e76e26bb4f698d97e.tar.gz |
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: 2e0d0bc050b44afaeb017cc30ac409c743b9b171
-rw-r--r-- | src/settings/plugins/ifcfg-rh/writer.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/settings/plugins/ifcfg-rh/writer.c b/src/settings/plugins/ifcfg-rh/writer.c index 574a1bba7a..d95915f4f2 100644 --- a/src/settings/plugins/ifcfg-rh/writer.c +++ b/src/settings/plugins/ifcfg-rh/writer.c @@ -1136,10 +1136,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 "); @@ -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)) 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); |