[minip] Fix undefined behavior in mac_addr_copy

There was a possibly unaligned store in mac_addr_copy.
Replace it with a memcpy call that should generate equivalent,
well defined code.
This commit is contained in:
Pedro Falcato
2023-02-18 23:22:38 +00:00
committed by Travis Geiselbrecht
parent 81d6014493
commit bf2e94c2f8

View File

@@ -141,6 +141,5 @@ bool net_timer_cancel(net_timer_t *) __NONNULL();
void net_timer_init(void);
static inline void mac_addr_copy(uint8_t *dest, const uint8_t *src) {
*(uint32_t *)dest = *(const uint32_t *)src;
*(uint16_t *)(dest + 4) = *(const uint16_t *)(src + 4);
memcpy(dest, src, 6);
}