On Tuesday, March 18, 2014 2:04 PM, Joel Pelaez Jorge wrote:In the first case, is necessary use memcpy for copy te ethernet address to dev->dev_addr because this is a pointer, uses dev->addr_len for define size.
@@ -810,8 +810,8 @@ static int slic_mac_set_address(struct net_device
*dev, void *ptr)
if (!is_valid_ether_addr(addr->sa_data))
return -EINVAL;
- memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
- memcpy(adapter->currmacaddr, addr->sa_data, dev->addr_len);
+ ether_addr_copy(dev->dev_addr, addr->sa_data);
+ ether_addr_copy(adapter->currmacaddr, addr->sa_data);
By the way, I am wondering if 'dev->addr_len' is 6 bytes.
Is there anyone who can confirm it?
If nobody can confirm 'dev->addr_len' is 6 bytes, it should
not be changed to 'ether_addr_copy()'.
Best regards,
Jingoo Han