summaryrefslogtreecommitdiffstats
path: root/net/ethtool
diff options
context:
space:
mode:
authorJustin Chen <justin.chen@broadcom.com>2023-06-12 23:37:00 +0200
committerJakub Kicinski <kuba@kernel.org>2023-06-14 07:05:52 +0200
commit2bddad9ec65a925da4ab4f73a9377d80540ca67b (patch)
treed501f46e2c16a1e8e36b5399ffa1332a1f19bb0e /net/ethtool
parentmctp i2c: Switch back to use struct i2c_driver's .probe() (diff)
downloadlinux-2bddad9ec65a925da4ab4f73a9377d80540ca67b.tar.xz
linux-2bddad9ec65a925da4ab4f73a9377d80540ca67b.zip
ethtool: ioctl: account for sopass diff in set_wol
sopass won't be set if wolopt doesn't change. This means the following will fail to set the correct sopass. ethtool -s eth0 wol s sopass 11:22:33:44:55:66 ethtool -s eth0 wol s sopass 22:44:55:66:77:88 Make sure we call into the driver layer set_wol if sopass is different. Fixes: 55b24334c0f2 ("ethtool: ioctl: improve error checking for set_wol") Signed-off-by: Justin Chen <justin.chen@broadcom.com> Link: https://lore.kernel.org/r/1686605822-34544-1-git-send-email-justin.chen@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ethtool')
-rw-r--r--net/ethtool/ioctl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
index 37b582225854..4a51e0ec295c 100644
--- a/net/ethtool/ioctl.c
+++ b/net/ethtool/ioctl.c
@@ -1452,7 +1452,8 @@ static int ethtool_set_wol(struct net_device *dev, char __user *useraddr)
if (wol.wolopts & ~cur_wol.supported)
return -EINVAL;
- if (wol.wolopts == cur_wol.wolopts)
+ if (wol.wolopts == cur_wol.wolopts &&
+ !memcmp(wol.sopass, cur_wol.sopass, sizeof(wol.sopass)))
return 0;
ret = dev->ethtool_ops->set_wol(dev, &wol);