aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/realtek/r8169.c
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2018-06-25 20:34:41 +0200
committerDavid S. Miller <davem@davemloft.net>2018-06-26 23:07:01 +0900
commit2f533f6bd8300b11e8d941c9a8f51183a9d88c9c (patch)
tree35051412cc365d73c30803e571e57474642dceaa /drivers/net/ethernet/realtek/r8169.c
parentselftests: net: Test headroom handling of ip6_gre devices (diff)
downloadlinux-dev-2f533f6bd8300b11e8d941c9a8f51183a9d88c9c.tar.xz
linux-dev-2f533f6bd8300b11e8d941c9a8f51183a9d88c9c.zip
r8169: reject unsupported WoL options
So far unsupported WoL options are silently ignored. Change this and reject attempts to set unsupported options. This prevents situations where a user tries to set an unsupported WoL option and is under the impression it was successful because ethtool doesn't complain. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/ethernet/realtek/r8169.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 1d33672c650d..70c13cc282d0 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -1712,11 +1712,14 @@ static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
struct rtl8169_private *tp = netdev_priv(dev);
struct device *d = tp_to_dev(tp);
+ if (wol->wolopts & ~WAKE_ANY)
+ return -EINVAL;
+
pm_runtime_get_noresume(d);
rtl_lock_work(tp);
- tp->saved_wolopts = wol->wolopts & WAKE_ANY;
+ tp->saved_wolopts = wol->wolopts;
if (pm_runtime_active(d))
__rtl8169_set_wol(tp, tp->saved_wolopts);