From: Roy Marples Date: Wed, 12 Feb 2025 12:02:53 +0000 (+0000) Subject: DHCP: Align the BPF buffer to sizeof(struct ip *) X-Git-Tag: v10.2.0~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=07a5fdd7d34b072e52c316877d14c6d2581cb379;p=thirdparty%2Fdhcpcd.git DHCP: Align the BPF buffer to sizeof(struct ip *) This is for non privsep only and should fix Sparc64. Fixes #430. --- diff --git a/src/dhcp.c b/src/dhcp.c index d521e201..504e0131 100644 --- a/src/dhcp.c +++ b/src/dhcp.c @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -3715,7 +3716,8 @@ static void dhcp_readbpf(void *arg, unsigned short events) { struct interface *ifp = arg; - uint8_t buf[FRAMELEN_MAX]; + /* Sparc64 needs this buffer aligned */ + alignas(sizeof(struct ip *)) uint8_t buf[FRAMELEN_MAX]; ssize_t bytes; struct dhcp_state *state = D_STATE(ifp); struct bpf *bpf = state->bpf;