From: Roy Marples Date: Mon, 20 Apr 2020 21:18:41 +0000 (+0100) Subject: DHCP: Avoid mis-aligned BOOTP structure X-Git-Tag: v9.0.2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=504992bdff47a6efeda0503022d333f7c0c63025;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. */