* [PATCH] forcedeth: mac address fix
@ 2009-11-13 12:22 Stanislav O. Bezzubtsev
2009-11-14 3:52 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Stanislav O. Bezzubtsev @ 2009-11-13 12:22 UTC (permalink / raw)
Cc: davem, aabdulla, yinghai, netdev, linux-kernel, Stanislav O. Bezzubtsev
Set second bit of randomly generated mac. That marks MAC
as locally assigned. IEEE802.3, section one, 3.2.3.
Signed-off-by: Stanislav O. Bezzubtsev <stas@lvk.cs.msu.su>
---
drivers/net/forcedeth.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index e1da466..b404c7a 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -5821,7 +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[0] = 0x02; /* set local assignment bit */
dev->dev_addr[1] = 0x00;
dev->dev_addr[2] = 0x6c;
get_random_bytes(&dev->dev_addr[3], 3);
--
1.6.5
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] forcedeth: mac address fix
2009-11-13 12:22 [PATCH] forcedeth: mac address fix Stanislav O. Bezzubtsev
@ 2009-11-14 3:52 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2009-11-14 3:52 UTC (permalink / raw)
To: stas; +Cc: aabdulla, yinghai, netdev, linux-kernel
From: "Stanislav O\. Bezzubtsev" <stas@lvk.cs.msu.su>
Date: Fri, 13 Nov 2009 15:22:55 +0300
> Set second bit of randomly generated mac. That marks MAC
> as locally assigned. IEEE802.3, section one, 3.2.3.
>
> Signed-off-by: Stanislav O. Bezzubtsev <stas@lvk.cs.msu.su>
Do you know why this driver even has this bug?
It's because it does not use random_ether_addr() and tries to
do it by hand all by itself.
Please fix this bug for real by having the driver use the proper
interface to calculate a randomized ethernet address.
Thank you.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] forcedeth: mac address fix
@ 2009-11-14 8:31 Stanislav O. Bezzubtsev
2009-11-16 5:17 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Stanislav O. Bezzubtsev @ 2009-11-14 8:31 UTC (permalink / raw)
Cc: davem, aabdulla, yinghai, netdev, linux-kernel, Stanislav O. Bezzubtsev
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-11-16 5:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-13 12:22 [PATCH] forcedeth: mac address fix Stanislav O. Bezzubtsev
2009-11-14 3:52 ` David Miller
2009-11-14 8:31 Stanislav O. Bezzubtsev
2009-11-16 5:17 ` David Miller
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®