diff options
author | Thomas Haller <thaller@redhat.com> | 2015-09-25 16:38:09 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2015-10-09 12:12:07 +0200 |
commit | f062d2747321efe1b11df2d18c4a24786a62b44a (patch) | |
tree | c2ba692fc3165607981e09eff2c805fe6dc2b0db | |
parent | c995432ccb688a927f7702ff49849c2b246d61aa (diff) | |
download | NetworkManager-bg/wol-add-ignore-option-bgo755182.tar.gz |
fixup! wake-on-lan: add option to keep existing settingsbg/wol-add-ignore-option-bgo755182
- add comment
- leave a larger gap between the last flag and IGNORE. After
all there is space as the enum *must* compile to a guint
(otherwise the usage of GFlags is broken).
But good idea, to leave a gap!!
-rw-r--r-- | libnm-core/nm-setting-wired.h | 10 | ||||
-rw-r--r-- | src/devices/nm-device-ethernet.c | 4 |
2 files changed, 8 insertions, 6 deletions
diff --git a/libnm-core/nm-setting-wired.h b/libnm-core/nm-setting-wired.h index 172aa58a43..7eb53d3021 100644 --- a/libnm-core/nm-setting-wired.h +++ b/libnm-core/nm-setting-wired.h @@ -49,11 +49,13 @@ G_BEGIN_DECLS * @NM_SETTING_WIRED_WAKE_ON_LAN_BROADCAST: Wake on broadcast messages * @NM_SETTING_WIRED_WAKE_ON_LAN_ARP: Wake on ARP * @NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC: Wake on magic packet - * @NM_SETTING_WIRED_WAKE_ON_LAN_ALL: Wake on all events + * @NM_SETTING_WIRED_WAKE_ON_LAN_ALL: Wake on all events. This does not + * include the exclusive flags @NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT or + * @NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE. * @NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT: Use the default value * @NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE: Don't change configured settings * @NM_SETTING_WIRED_WAKE_ON_LAN_EXCLUSIVE_FLAGS: Mask of flags that are - * incompatible with other flags + * incompatible with other flags * * Options for #NMSettingWired:wake-on-lan. Note that not all options * are supported by all devices. @@ -70,10 +72,10 @@ typedef enum { /*< flags >*/ NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC = (1 << 6), _NM_SETTING_WIRED_WAKE_ON_LAN_LAST_OPT, /*< skip >*/ - NM_SETTING_WIRED_WAKE_ON_LAN_ALL = ((_NM_SETTING_WIRED_WAKE_ON_LAN_LAST_OPT - 1) << 1) - NM_SETTING_WIRED_WAKE_ON_LAN_PHY, /*< skip >*/ + NM_SETTING_WIRED_WAKE_ON_LAN_ALL = (((_NM_SETTING_WIRED_WAKE_ON_LAN_LAST_OPT - 1) << 1) - 1) - (1 << 0 /*DEFAULT*/), /*< skip >*/ NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT = (1 << 0), - NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE = (1 << 10), + NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE = (1 << 15), NM_SETTING_WIRED_WAKE_ON_LAN_EXCLUSIVE_FLAGS = NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT | NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE, /*< skip >*/ } NMSettingWiredWakeOnLan; diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c index 13923dd9fd..d1202dc72f 100644 --- a/src/devices/nm-device-ethernet.c +++ b/src/devices/nm-device-ethernet.c @@ -1237,9 +1237,9 @@ wake_on_lan_enable (NMDevice *device) G_MAXINT32, NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT); - if (NM_FLAGS_ANY (wol, NM_SETTING_WIRED_WAKE_ON_LAN_EXCLUSIVE_FLAGS) + if ( NM_FLAGS_ANY (wol, NM_SETTING_WIRED_WAKE_ON_LAN_EXCLUSIVE_FLAGS) && !nm_utils_is_power_of_two (wol)) { - nm_log_dbg (LOGD_ETHER, "invalid default value %d for wake-on-lan", (int) wol); + nm_log_dbg (LOGD_ETHER, "invalid default value %u for wake-on-lan", (guint) wol); wol = NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT; } if (wol != NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT) |