From 07a5fdd7d34b072e52c316877d14c6d2581cb379 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 12 Feb 2025 12:02:53 +0000 Subject: [PATCH] DHCP: Align the BPF buffer to sizeof(struct ip *) This is for non privsep only and should fix Sparc64. Fixes #430. --- src/dhcp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.47.3