[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1686605822-34544-1-git-send-email-justin.chen@broadcom.com>
Date: Mon, 12 Jun 2023 14:37:00 -0700
From: Justin Chen <justin.chen@...adcom.com>
To: netdev@...r.kernel.org
Cc: bcm-kernel-feedback-list@...adcom.com,
Justin Chen <justin.chen@...adcom.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Andrew Lunn <andrew@...n.ch>,
Daniil Tatianin <d-tatianin@...dex-team.ru>,
Marco Bonelli <marco@...eim.net>,
Vincent Mailhol <mailhol.vincent@...adoo.fr>,
Maxim Korotkov <korotkov.maxim.s@...il.com>,
Gal Pressman <gal@...dia.com>, Jiri Pirko <jiri@...nulli.us>,
Kuniyuki Iwashima <kuniyu@...zon.com>,
Simon Horman <simon.horman@...igine.com>,
Florian Fainelli <florian.fainelli@...adcom.com>,
linux-kernel@...r.kernel.org (open list)
Subject: [PATCH net-next] 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@...adcom.com>
---
Note: Tagged "Fixes" patch has not hit rc yet.
net/ethtool/ioctl.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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);
--
2.7.4
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4206 bytes)
Powered by blists - more mailing lists