ralink: use random generate mac address instead of default one.
[openwrt/svn-archive/archive.git] / target / linux / ramips / files / drivers / net / ethernet / ralink / ralink_soc_eth.c
index 96bc0e5fb1163c530cf61f14a3ab11ca643d1875..c21643bbd3b41381e54a8090df25042e6fb18d93 100644 (file)
@@ -1228,9 +1228,12 @@ static int __init fe_init(struct net_device *dev)
                priv->soc->switch_init(priv);
 
        of_get_mac_address_mtd(priv->device->of_node, dev->dev_addr);
-       /*If the mac address is invalid, use default mac address  */
-       if (!is_valid_ether_addr(dev->dev_addr))
-               memcpy(dev->dev_addr, priv->soc->mac, ETH_ALEN);
+       /*If the mac address is invalid, use random mac address  */
+       if (!is_valid_ether_addr(dev->dev_addr)) {
+               random_ether_addr(dev->dev_addr);
+               dev_err(priv->device, "generated random MAC address %pM\n",
+                               dev->dev_addr);
+       }
 
        err = fe_mdio_init(priv);
        if (err)