[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1370264080.2025.29.camel@joe-AO722>
Date: Mon, 03 Jun 2013 05:54:40 -0700
From: Joe Perches <joe@...ches.com>
To: Lucas Stach <l.stach@...gutronix.de>
Cc: netdev@...r.kernel.org, davem@...emloft.net,
Pavel Machek <pavel@...x.de>
Subject: Re: [PATCHv2 net-next] net: fec: add fallback to random MAC address
On Mon, 2013-06-03 at 12:38 +0200, Lucas Stach wrote:
> If no valid MAC address could be obtained from the hardware,
> fall back to a randomly generated one.
[]
> diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
[]
> @@ -1039,6 +1039,18 @@ static void fec_get_mac(struct net_device *ndev)
[]
> + if (!is_valid_ether_addr(iap)) {
> + /* Report it and use a random ethernet address instead */
> + netdev_err(ndev, "Invalid MAC address: %pM\n", iap);
> + eth_hw_addr_random(ndev);
> + netdev_info(ndev, "Using random MAC address: %pM\n",
> + ndev->dev_addr);
Perhaps a single line message would be better, something like:
eth_hw_addr_random(ndev);
netdev_info(ndev, "Has invalid MAC addr %pM, using random %pM\n",
iap, ndev->dev_addr);
Looking treewide at uses of eth_hw_addr_random, there's no
standard message so maybe standardization is a possible
effort for another time.
--
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