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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 03 May 2011 16:42:25 -0300
From:	Kleber Sacilotto de Souza <klebers@...ux.vnet.ibm.com>
To:	netdev@...r.kernel.org
Subject: [PATCH] net: ehea: fix wrongly-reported supported modes

Currently EHEA reports to ethtool as supporting 10000baseT_Full and
FIBRE independent of the hardware configuration. However, these
capabilities should be reported only if the physical port and
the medium support them, which is the case where the physical port
is connected at 10Gb.

Signed-off-by: Kleber Sacilotto de Souza <klebers@...ux.vnet.ibm.com>
---
 drivers/net/ehea/ehea_ethtool.c |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ehea/ehea_ethtool.c b/drivers/net/ehea/ehea_ethtool.c
index 3e2e734..04716c2 100644
--- a/drivers/net/ehea/ehea_ethtool.c
+++ b/drivers/net/ehea/ehea_ethtool.c
@@ -55,15 +55,22 @@ static int ehea_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 		cmd->duplex = -1;
 	}

-	cmd->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_1000baseT_Full
-		       | SUPPORTED_100baseT_Full |  SUPPORTED_100baseT_Half
-		       | SUPPORTED_10baseT_Full | SUPPORTED_10baseT_Half
-		       | SUPPORTED_Autoneg | SUPPORTED_FIBRE);
+	cmd->supported = (SUPPORTED_1000baseT_Full | SUPPORTED_100baseT_Full
+		       | SUPPORTED_100baseT_Half | SUPPORTED_10baseT_Full
+		       | SUPPORTED_10baseT_Half | SUPPORTED_Autoneg);

-	cmd->advertising = (ADVERTISED_10000baseT_Full | ADVERTISED_Autoneg
-			 | ADVERTISED_FIBRE);
+	cmd->advertising = ADVERTISED_Autoneg;
+
+	if (cmd->speed == SPEED_10000) {
+		cmd->supported |= (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE);
+		cmd->advertising |= (ADVERTISED_10000baseT_Full | ADVERTISED_FIBRE);
+		cmd->port = PORT_FIBRE;
+	} else {
+		cmd->supported |= SUPPORTED_TP;
+		cmd->advertising |= (ADVERTISED_1000baseT_Full | ADVERTISED_TP);
+		cmd->port = PORT_TP;
+	}

-	cmd->port = PORT_FIBRE;
 	cmd->autoneg = port->autoneg == 1 ? AUTONEG_ENABLE : AUTONEG_DISABLE;

 	return 0;
-- 
1.7.1



--
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