From: Tim Harvey Date: Mon, 29 Sep 2025 19:21:49 +0000 (-0700) Subject: net: lwip: ensure alignment of packet buffers X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b2217c935e3f30d15821b1c5183ab4dd4c9d9dd2;p=thirdparty%2Fu-boot.git net: lwip: ensure alignment of packet buffers Network packet buffers should be aligned to PKTALIGN. Add a compiler attribute to ensure this. Signed-off-by: Tim Harvey [jf: use __aligned(x) from ] Signed-off-by: Jerome Forissier --- diff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c index 1a70cedfb58..8741f65fe12 100644 --- a/net/lwip/net-lwip.c +++ b/net/lwip/net-lwip.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -30,7 +31,8 @@ void (*push_packet)(void *, int len) = 0; int net_try_count; static int net_restarted; int net_restart_wrap; -static uchar net_pkt_buf[(PKTBUFSRX) * PKTSIZE_ALIGN + PKTALIGN]; +static uchar net_pkt_buf[(PKTBUFSRX) * PKTSIZE_ALIGN + PKTALIGN] + __aligned(PKTALIGN); uchar *net_rx_packets[PKTBUFSRX]; uchar *net_rx_packet; const u8 net_bcast_ethaddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };