lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1432334609-3971-3-git-send-email-aparames@broadcom.com>
Date:	Fri, 22 May 2015 15:43:29 -0700
From:	Arun Parameswaran <aparames@...adcom.com>
To:	Ben Hutchings <bwh@...nel.org>
CC:	<netdev@...r.kernel.org>, <jdzheng@...adcom.com>,
	<aparames@...adcom.com>
Subject: [PATCH 2/2] ethtool: Fix an issue with handling 'phyad' while updating settings

When using the 'ethtool' to set PHY1's settings, the 'ethtool'
seems to do the 'get' settings with incorrect PHY ID and then
apply the new settings on it.

For example when using the command, to change PHY1's speed,
'ethtool -s eth0 phyad 1 speed 100', the 'ethtool' will end up
querying PHY0's settings and then apply the new settings specified
in the command on top of the PHY0's settings. So the PHY1 will
end up with worng settings (partial settings of PHY0 for example).

This patch fixes the issue by specifying the 'phyad' or 'port'
requested in the command to query for the settings, before applying
the new ones.

Signed-off-by: Arun Parameswaran <aparames@...adcom.com>
Reviewed-by: JD (Jiandong) Zheng <jdzheng@...adcom.com>
---
 ethtool.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/ethtool.c b/ethtool.c
index 668c189..6c57297 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -2523,6 +2523,12 @@ static int do_sset(struct cmd_context *ctx)
 
 		memset(&ecmd, 0, sizeof(struct ethtool_cmd));
 
+		if (phyad_wanted != -1)
+			ecmd.phy_address = phyad_wanted;
+
+		if (port_wanted != -1)
+			ecmd.port = port_wanted;
+
 		ecmd.cmd = ETHTOOL_GSET;
 		err = send_ioctl(ctx, &ecmd);
 		if (err < 0) {
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ