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: <a6ba75577552abe8d5045434030c276d5f45779a.1300724245.git.LW@KARO-electronics.de>
Date:	Mon, 21 Mar 2011 17:37:36 +0100
From:	Lothar Waßmann <LW@...O-electronics.de>
To:	netdev@...r.kernel.org
Cc:	<u.kleine-koenig@...gutronix.de>,
	Shawn Guo <shawn.guo@...escale.com>,
	Lothar Waßmann <LW@...O-electronics.de>
Subject: [PATCH 4/4] drivers/net/fec: Don't mess with configured MAC addresses.

The FEC driver currently uses the MAC address assigned to the first
interface incremented by one for the second interface.

Change this to be able to configure distinct MAC addresses via
platform_data.

Signed-off-by: Lothar Waßmann <LW@...O-electronics.de>
---
 drivers/net/fec.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 3666524..9d89e99 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -750,13 +750,12 @@ static void __inline__ fec_get_mac(struct net_device *ndev)
 	/*
 	 * 2) from flash or fuse (via platform data)
 	 */
+	if (pdata)
+		memcpy(iap, pdata->mac, ETH_ALEN);
 	if (!is_valid_ether_addr(iap)) {
 #ifdef CONFIG_M5272
 		if (FEC_FLASHMAC)
 			iap = (unsigned char *)FEC_FLASHMAC;
-#else
-		if (pdata)
-			memcpy(iap, pdata->mac, ETH_ALEN);
 #endif
 	}
 
@@ -772,10 +771,6 @@ static void __inline__ fec_get_mac(struct net_device *ndev)
 	}
 
 	memcpy(ndev->dev_addr, iap, ETH_ALEN);
-
-	/* Adjust MAC if using macaddr */
-	if (iap == macaddr)
-		 ndev->dev_addr[ETH_ALEN-1] = macaddr[ETH_ALEN-1] + fep->pdev->id;
 }
 
 /* ------------------------------------------------------------------------- */
-- 
1.5.6.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