Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f533f6b authored by Heiner Kallweit's avatar Heiner Kallweit Committed by David S. Miller
Browse files

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: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 99672eb6
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -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 rtl8169_private *tp = netdev_priv(dev);
	struct device *d = tp_to_dev(tp);
	struct device *d = tp_to_dev(tp);


	if (wol->wolopts & ~WAKE_ANY)
		return -EINVAL;

	pm_runtime_get_noresume(d);
	pm_runtime_get_noresume(d);


	rtl_lock_work(tp);
	rtl_lock_work(tp);


	tp->saved_wolopts = wol->wolopts & WAKE_ANY;
	tp->saved_wolopts = wol->wolopts;


	if (pm_runtime_active(d))
	if (pm_runtime_active(d))
		__rtl8169_set_wol(tp, tp->saved_wolopts);
		__rtl8169_set_wol(tp, tp->saved_wolopts);