From: Joe Perches <joe@perches.com>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
Pavel Machek <pavel@denx.de>
Subject: Re: [PATCHv2 net-next] net: fec: add fallback to random MAC address
Date: Mon, 03 Jun 2013 05:54:40 -0700 [thread overview]
Message-ID: <1370264080.2025.29.camel@joe-AO722> (raw)
In-Reply-To: <1370255919-12762-1-git-send-email-l.stach@pengutronix.de>
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.
next prev parent reply other threads:[~2013-06-03 12:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-03 10:38 [PATCHv2 net-next] net: fec: add fallback to random MAC address Lucas Stach
2013-06-03 11:30 ` Sergei Shtylyov
2013-06-03 11:33 ` Sergei Shtylyov
2013-06-03 12:54 ` Joe Perches [this message]
2013-06-05 0:00 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1370264080.2025.29.camel@joe-AO722 \
--to=joe@perches.com \
--cc=davem@davemloft.net \
--cc=l.stach@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=pavel@denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).