net: axienet: use eth_hw_addr_random()
authorTobias Klauser <tklauser@distanz.ch>
Tue, 28 Feb 2017 11:21:12 +0000 (12:21 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 7 Mar 2017 01:15:41 +0000 (17:15 -0800)
Use eth_hw_addr_random() to set a random MAC address in order to make
sure ndev->addr_assign_type will be properly set to NET_ADDR_RANDOM.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/xilinx/xilinx_axienet_main.c

index b96e96919e31d2da791da73aeeaad6e85fd8c581..33c595f4691d93e3f2b73f85f9e92dba9dbead7f 100644 (file)
@@ -301,7 +301,7 @@ static void axienet_set_mac_address(struct net_device *ndev,
        if (address)
                memcpy(ndev->dev_addr, address, ETH_ALEN);
        if (!is_valid_ether_addr(ndev->dev_addr))
-               eth_random_addr(ndev->dev_addr);
+               eth_hw_addr_random(ndev);
 
        /* Set up unicast MAC address filter set its mac address */
        axienet_iow(lp, XAE_UAW0_OFFSET,