Fix MAC address access in 3c507, ibmlana, pcnet32 and libertas
Commit f001fde5ea
changed
net_device.dev_addr from a 32-byte array to a pointer.
I found 4 ethernet drivers which rely on sizeof(dev_addr), which are now
only copying 4 bytes of the address information on 32bit systems.
Fix them to use ETH_ALEN.
Signed-off-by: Daniel Drake <dsd@laptop.org>
Reviewed-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
f74dac0859
commit
1f04493123
@@ -45,6 +45,7 @@ static const char *const version =
|
||||
#include <linux/crc32.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/if_ether.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/moduleparam.h>
|
||||
@@ -1765,7 +1766,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
|
||||
|
||||
/* if the ethernet address is not valid, force to 00:00:00:00:00:00 */
|
||||
if (!is_valid_ether_addr(dev->perm_addr))
|
||||
memset(dev->dev_addr, 0, sizeof(dev->dev_addr));
|
||||
memset(dev->dev_addr, 0, ETH_ALEN);
|
||||
|
||||
if (pcnet32_debug & NETIF_MSG_PROBE) {
|
||||
printk(" %pM", dev->dev_addr);
|
||||
|
Reference in New Issue
Block a user