diff options
author | Daniel Drake <dsd@laptop.org> | 2009-12-24 03:11:24 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-26 23:24:45 -0500 |
commit | 1f04493123763f5b8bc6d5de9aed0222345c052c (patch) | |
tree | 85b27e8a82a63a875740b67e9016fc11f432c453 /drivers/net/pcnet32.c | |
parent | f74dac0859bd9678b289ad9dc215026fd7ce033e (diff) |
Fix MAC address access in 3c507, ibmlana, pcnet32 and libertas
Commit f001fde5eadd915f4858d22ed70d7040f48767cf 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>
Diffstat (limited to 'drivers/net/pcnet32.c')
-rw-r--r-- | drivers/net/pcnet32.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c index dcc67a35e8f2..e154677ff706 100644 --- a/drivers/net/pcnet32.c +++ b/drivers/net/pcnet32.c | |||
@@ -45,6 +45,7 @@ static const char *const version = | |||
45 | #include <linux/crc32.h> | 45 | #include <linux/crc32.h> |
46 | #include <linux/netdevice.h> | 46 | #include <linux/netdevice.h> |
47 | #include <linux/etherdevice.h> | 47 | #include <linux/etherdevice.h> |
48 | #include <linux/if_ether.h> | ||
48 | #include <linux/skbuff.h> | 49 | #include <linux/skbuff.h> |
49 | #include <linux/spinlock.h> | 50 | #include <linux/spinlock.h> |
50 | #include <linux/moduleparam.h> | 51 | #include <linux/moduleparam.h> |
@@ -1765,7 +1766,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
1765 | 1766 | ||
1766 | /* if the ethernet address is not valid, force to 00:00:00:00:00:00 */ | 1767 | /* if the ethernet address is not valid, force to 00:00:00:00:00:00 */ |
1767 | if (!is_valid_ether_addr(dev->perm_addr)) | 1768 | if (!is_valid_ether_addr(dev->perm_addr)) |
1768 | memset(dev->dev_addr, 0, sizeof(dev->dev_addr)); | 1769 | memset(dev->dev_addr, 0, ETH_ALEN); |
1769 | 1770 | ||
1770 | if (pcnet32_debug & NETIF_MSG_PROBE) { | 1771 | if (pcnet32_debug & NETIF_MSG_PROBE) { |
1771 | printk(" %pM", dev->dev_addr); | 1772 | printk(" %pM", dev->dev_addr); |