Skip to content

Commit 2bddad9

Browse files
Ryceancurrykuba-moo
authored andcommitted
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: 55b2433 ("ethtool: ioctl: improve error checking for set_wol") Signed-off-by: Justin Chen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent e5d4a21 commit 2bddad9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/ethtool/ioctl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,8 @@ static int ethtool_set_wol(struct net_device *dev, char __user *useraddr)
14521452
if (wol.wolopts & ~cur_wol.supported)
14531453
return -EINVAL;
14541454

1455-
if (wol.wolopts == cur_wol.wolopts)
1455+
if (wol.wolopts == cur_wol.wolopts &&
1456+
!memcmp(wol.sopass, cur_wol.sopass, sizeof(wol.sopass)))
14561457
return 0;
14571458

14581459
ret = dev->ethtool_ops->set_wol(dev, &wol);

0 commit comments

Comments
 (0)