Skip to contentSkip to conversation

etherdevice: use __dev_addr_set()

PATCH Applied Jakub Kicinski 2 participants 2 messages Oct 4, 2021 – Oct 5, 2021

Subsystems (2)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 etherdevice: use __dev_addr_set()

Andrew points out that eth_hw_addr_set() replaces memcpy() calls so we can't use ether_addr_copy() which assumes both arguments are 2-bytes aligned.

---
 include/linux/etherdevice.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/etherdevice.h +1 -1
index e7b2e5fd8d24..c8442d954d19 100644
@@ -308,7 +308,7 @@ static inline void ether_addr_copy(u8 *dst, const u8 *src)
  */
 static inline void eth_hw_addr_set(struct net_device *dev, const u8 *addr)
 {
-	ether_addr_copy(dev->dev_addr, addr);
+	__dev_addr_set(dev, addr, ETH_ALEN);
 }
 
 /**
Signature · 1 line
2.31.1
#1 lore raw
This patch was applied to netdev/net.git (refs/heads/master):

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

Quoted 8 lines · On Mon, 4 Oct 2021 16:01:40 -0700 you wrote:

Andrew points out that eth_hw_addr_set() replaces memcpy() calls so we can't use ether_addr_copy() which assumes both arguments are 2-bytes aligned.

[...]

Here is the summary with links:
- [net] etherdevice: use __dev_addr_set()

    https://git.kernel.org/netdev/net/c/3f6cffb8604b

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html