ibmveth: Fix endian issues with MAC addresses
David Miller
davem at davemloft.net
Fri Mar 7 08:27:37 EST 2014
From: Anton Blanchard <anton at samba.org>
Date: Wed, 5 Mar 2014 14:51:37 +1100
> The code to load a MAC address into a u64 for passing to the
> hypervisor via a register is broken on little endian.
>
> Create a helper function called ibmveth_encode_mac_addr
> which does the right thing in both big and little endian.
>
> We were storing the MAC address in a long in struct ibmveth_adapter.
> It's never used so remove it - we don't need another place in the
> driver where we create endian issues with MAC addresses.
>
> Signed-off-by: Anton Blanchard <anton at samba.org>
> Cc: stable at vger.kernel.org
Applied, thanks Anton.
> - memcpy(&adapter->mac_addr, mac_addr_p, ETH_ALEN);
...
> - unsigned long mac_addr;
That's some scary stuff right there.
More information about the Linuxppc-dev
mailing list