From: Roy Marples Date: Mon, 20 Apr 2020 21:18:41 +0000 (+0100) Subject: DHCP: Avoid mis-aligned BOOTP structure X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1dc1fce7ae7b4c106a8eb631ed92ab1ed8e86bbc;p=thirdparty%2Fdhcpcd.git DHCP: Avoid mis-aligned BOOTP structure This was caused by the recent change to pass back the frame header. --- diff --git a/src/dhcp.c b/src/dhcp.c index 879ce3e5..3fd72f85 100644 --- a/src/dhcp.c +++ b/src/dhcp.c @@ -3494,8 +3494,9 @@ dhcp_packet(struct interface *ifp, uint8_t *data, size_t len) __func__, ifp->name); return; } - data += fl; len -= fl; + /* Move the data to avoid alignment errors. */ + memmove(data, data + fl, len); } /* Validate filter. */