Commit 49ac9cc3 authored by Santiago Leon's avatar Santiago Leon Committed by Linus Torvalds

[PATCH] PowerPC Virtual Ethernet duplicate MAC addresses

This fixes a bug where different partitions were assigned the same MAC
address.  Also, according to Anton, gcc 3.5 didn't like our mac_addr_p
gymnastics, so this ends up fixing that as well.
parent 862d5483
...@@ -874,14 +874,14 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_ ...@@ -874,14 +874,14 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
struct net_device *netdev; struct net_device *netdev;
struct ibmveth_adapter *adapter; struct ibmveth_adapter *adapter;
unsigned int *mac_addr_p; unsigned char *mac_addr_p;
unsigned int *mcastFilterSize_p; unsigned int *mcastFilterSize_p;
ibmveth_debug_printk_no_adapter("entering ibmveth_probe for UA 0x%x\n", ibmveth_debug_printk_no_adapter("entering ibmveth_probe for UA 0x%x\n",
dev->unit_address); dev->unit_address);
mac_addr_p = (unsigned int *) vio_get_attribute(dev, VETH_MAC_ADDR, 0); mac_addr_p = (unsigned char *) vio_get_attribute(dev, VETH_MAC_ADDR, 0);
if(!mac_addr_p) { if(!mac_addr_p) {
ibmveth_error_printk("Can't find VETH_MAC_ADDR attribute\n"); ibmveth_error_printk("Can't find VETH_MAC_ADDR attribute\n");
return 0; return 0;
...@@ -916,8 +916,8 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_ ...@@ -916,8 +916,8 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
The RPA doc specifies that the first byte must be 10b, so The RPA doc specifies that the first byte must be 10b, so
we'll just look for it to solve this 8 vs. 6 byte field issue */ we'll just look for it to solve this 8 vs. 6 byte field issue */
while (*((char*)mac_addr_p) != (char)(0x02)) if ((*mac_addr_p & 0x3) != 0x02)
((char*)mac_addr_p)++; mac_addr_p += 2;
adapter->mac_addr = 0; adapter->mac_addr = 0;
memcpy(&adapter->mac_addr, mac_addr_p, 6); memcpy(&adapter->mac_addr, mac_addr_p, 6);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment