mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Stanislav O\. Bezzubtsev" <stas@lvk.cs.msu.su>
To: unlisted-recipients:; (no To-header on input)
Cc: davem@davemloft.net, aabdulla@nvidia.com, yinghai@kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Stanislav O\. Bezzubtsev" <stas@lvk.cs.msu.su>
Subject: [PATCH] forcedeth: mac address fix
Date: Sat, 14 Nov 2009 11:31:25 +0300	[thread overview]
Message-ID: <1258187485-11549-1-git-send-email-stas@lvk.cs.msu.su> (raw)

Use the existing random_ether_addr() to generate random MAC
instead of doing it by-hand.

Signed-off-by: Stanislav O. Bezzubtsev <stas@lvk.cs.msu.su>
---
 drivers/net/forcedeth.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index e1da466..3116601 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -5821,10 +5821,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
 		        dev->dev_addr);
 		dev_printk(KERN_ERR, &pci_dev->dev,
 			"Please complain to your hardware vendor. Switching to a random MAC.\n");
-		dev->dev_addr[0] = 0x00;
-		dev->dev_addr[1] = 0x00;
-		dev->dev_addr[2] = 0x6c;
-		get_random_bytes(&dev->dev_addr[3], 3);
+		random_ether_addr(dev->dev_addr);
 	}
 
 	dprintk(KERN_DEBUG "%s: MAC Address %pM\n",
-- 
1.6.5


             reply	other threads:[~2009-11-14  8:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-14  8:31 Stanislav O. Bezzubtsev [this message]
2009-11-16  5:17 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2009-11-13 12:22 Stanislav O. Bezzubtsev
2009-11-14  3:52 ` 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=1258187485-11549-1-git-send-email-stas@lvk.cs.msu.su \
    --to=stas@lvk.cs.msu.su \
    --cc=aabdulla@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=yinghai@kernel.org \
    /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

all inboxes | Powered by JetHome®