changeset 5158:5f18174b5eb2 draft

DHCP: Avoid mis-aligned BOOTP structure This was caused by the recent change to pass back the frame header.
author Roy Marples <roy@marples.name>
date Mon, 20 Apr 2020 22:18:41 +0100
parents abb54c79cc7f
children 01d56b8eb743
files src/dhcp.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/dhcp.c	Mon Apr 20 15:31:57 2020 +0100
+++ b/src/dhcp.c	Mon Apr 20 22:18:41 2020 +0100
@@ -3494,8 +3494,9 @@
 			    __func__, ifp->name);
 			return;
 		}
-		data += fl;
 		len -= fl;
+		/* Move the data to avoid alignment errors. */
+		memmove(data, data + fl, len);
 	}
 
 	/* Validate filter. */