packages (LINUX_3_0): kernel/kernel-small_fixes.patch - randomize eth addre...

arekm arekm at pld-linux.org
Mon Mar 26 19:15:45 CEST 2012


Author: arekm                        Date: Mon Mar 26 17:15:45 2012 GMT
Module: packages                      Tag: LINUX_3_0
---- Log message:
- randomize eth address on 'broken' r8169 cards. Upstream doesn't want this patch but we do.

---- Files affected:
packages/kernel:
   kernel-small_fixes.patch (1.43.2.19 -> 1.43.2.20) 

---- Diffs:

================================================================
Index: packages/kernel/kernel-small_fixes.patch
diff -u packages/kernel/kernel-small_fixes.patch:1.43.2.19 packages/kernel/kernel-small_fixes.patch:1.43.2.20
--- packages/kernel/kernel-small_fixes.patch:1.43.2.19	Fri Mar  9 21:36:25 2012
+++ packages/kernel/kernel-small_fixes.patch	Mon Mar 26 19:15:40 2012
@@ -1033,3 +1033,26 @@
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
 
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 7a0c800..ec5ebbb 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -4103,6 +4103,14 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ 	/* Get MAC address */
+ 	for (i = 0; i < ETH_ALEN; i++)
+ 		dev->dev_addr[i] = RTL_R8(MAC0 + i);
++
++	if (!is_valid_ether_addr(dev->dev_addr)) {
++		/* Report it and use a random ethernet address instead */
++		netdev_err(dev, "Invalid MAC address: %pM\n", dev->dev_addr);
++		random_ether_addr(dev->dev_addr);
++		netdev_info(dev, "Using random MAC address: %pM\n",
++			    dev->dev_addr);
++	}
+ 	memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
+ 
+ 	SET_ETHTOOL_OPS(dev, &rtl8169_ethtool_ops);
+-- 
+1.7.7.3
+
+  
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/packages/kernel/kernel-small_fixes.patch?r1=1.43.2.19&r2=1.43.2.20



More information about the pld-cvs-commit mailing list