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-next>] [day] [month] [year] [list]
Date:	Sat,  5 Jan 2013 09:57:31 +0000
From:	Mark Einon <mark.einon@...il.com>
To:	bhutchings@...arflare.com
Cc:	netdev@...r.kernel.org, Mark Einon <mark.einon@...il.com>
Subject: [PATCH] ethtool: Add version check for et131x regs

Added a version check for the et131x reg dump, in case the dump format
needs to be changed later.

Signed-off-by: Mark Einon <mark.einon@...il.com>
---
 et131x.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/et131x.c b/et131x.c
index b36c184..8cdbec0 100644
--- a/et131x.c
+++ b/et131x.c
@@ -4,8 +4,12 @@
 
 int et131x_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
 {
+	u8 version = (u8)(regs->version >> 24);
 	u32 *reg = (u32 *)regs->data;
 
+	if(version != 1)
+		return -1;
+
 	fprintf(stdout, "PHY Registers\n");
 	fprintf(stdout, "0x0, Basic Control Reg          = 0x%04X\n", *reg++);
 	fprintf(stdout, "0x1, Basic Status Reg           = 0x%04X\n", *reg++);
-- 
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