[PATCH batadv 0/2] batman-adv: enforce u16 MAC address alignment
Sven Eckelmann <[email protected]>
| Newsgroups | org.open-mesh.lists.batman |
|---|---|
| Message-ID | <[email protected]> |
Sashiko reported problems with mac addresses on the stack as part of https://sashiko.dev/#/patchset/20260821094813.201800-1-sw%40simonwunderlich.de?part=5 > The mac array is allocated on the stack with 1-byte alignment by default. [...] > Because ether_addr_copy() casts the pointers to u16 to perform 16-bit > operations on these architectures, it strictly requires both the source and > destination pointers to be 2-byte aligned. Annote MAC address ETH_ALEN arrays to avoid this problem in the most common cases. Signed-off-by: Sven Eckelmann <[email protected]> --- Sven Eckelmann (2): batman-adv: ensure u16 aligned mac address arrays on stack batman-adv: ensure u16 aligned mac address in structs net/batman-adv/bridge_loop_avoidance.c | 6 ++++-- net/batman-adv/distributed-arp-table.c | 8 ++++---- net/batman-adv/mesh-interface.c | 12 ++++++++---- net/batman-adv/multicast.c | 6 +++--- net/batman-adv/types.h | 26 +++++++++++++------------- 5 files changed, 32 insertions(+), 26 deletions(-) --- base-commit: f3c33e7fcb7e88cc099b783faf26f0494b774571 change-id: 20260822-mac-u16-alignment-d25da5f6e8cc Best regards, -- Sven Eckelmann <[email protected]>