Skip to contentSkip to conversation

ioctl: do not pass transceiver value back to kernel

PATCH New Michal Kubecek 1 participant 1 message Jul 28, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ioctl: do not pass transceiver value back to kernel

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")
---
 ethtool.c | 2 ++
 1 file changed, 2 insertions(+)
ethtool.c +2 -0
index d37c223dcc04..1b99ac91dcbf 100644
@@ -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) {
Signature · 1 line
2.27.0