mirror of
https://github.com/systemd/systemd.git
synced 2025-03-31 14:50:15 +03:00
ethtool-util: do not try to enable unsupported WoL options
This commit is contained in:
parent
b4b2a49287
commit
20274ab86a
@ -425,6 +425,16 @@ int ethtool_set_wol(int *ethtool_fd, const char *ifname, uint32_t wolopts) {
|
||||
if (ioctl(*ethtool_fd, SIOCETHTOOL, &ifr) < 0)
|
||||
return -errno;
|
||||
|
||||
if ((wolopts & ~ecmd.supported) != 0) {
|
||||
_cleanup_free_ char *str = NULL;
|
||||
|
||||
(void) wol_options_to_string_alloc(wolopts & ~ecmd.supported, &str);
|
||||
log_debug("Network interface %s does not support requested Wake on LAN option(s) \"%s\", ignoring.",
|
||||
ifname, strna(str));
|
||||
|
||||
wolopts &= ecmd.supported;
|
||||
}
|
||||
|
||||
UPDATE(ecmd.wolopts, wolopts, need_update);
|
||||
|
||||
if (!need_update)
|
||||
|
Loading…
x
Reference in New Issue
Block a user