netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH ethtool] ioctl: do not pass transceiver value back to kernel
@ 2020-07-28 11:03 Michal Kubecek
  0 siblings, 0 replies; only message in thread
From: Michal Kubecek @ 2020-07-28 11:03 UTC (permalink / raw)
  To: netdev; +Cc: Ali MJ Al-Nasrawy, Florian Fainelli

While we want to report transceiver value in "ethtool <dev>" output, we
must not return nonzero value provided in ETHTOOL_GLINKSETTINGS reply back
to kernel in ETHTOOL_SLINKSETTINGS request.

Fixes: 8bb9a04002a3 ("ethtool.c: Report transceiver correctly")
Reported-by: Ali MJ Al-Nasrawy <alimjalnasrawy@gmail.com>
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
---
 ethtool.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ethtool.c b/ethtool.c
index d37c223dcc04..1b99ac91dcbf 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -2906,6 +2906,8 @@ static int do_sset(struct cmd_context *ctx)
 		struct ethtool_link_usettings *link_usettings;
 
 		link_usettings = do_ioctl_glinksettings(ctx);
+		memset(&link_usettings->deprecated, 0,
+		       sizeof(link_usettings->deprecated));
 		if (link_usettings == NULL)
 			link_usettings = do_ioctl_gset(ctx);
 		if (link_usettings == NULL) {
-- 
2.27.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-07-28 11:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-28 11:03 [PATCH ethtool] ioctl: do not pass transceiver value back to kernel Michal Kubecek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).