summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-04-20 22:18:41 +0100
committerRoy Marples <roy@marples.name>2020-04-20 22:18:41 +0100
commit1dc1fce7ae7b4c106a8eb631ed92ab1ed8e86bbc (patch)
tree38d84e1058d3a411608731131b84e4dd7bd8a39e /src
parent8d0925b0c2887e9fd83011cd3c99ee40f1ac2b0b (diff)
downloaddhcpcd-1dc1fce7ae7b4c106a8eb631ed92ab1ed8e86bbc.tar.xz
DHCP: Avoid mis-aligned BOOTP structure
This was caused by the recent change to pass back the frame header.
Diffstat (limited to 'src')
-rw-r--r--src/dhcp.c3
1 files changed, 2 insertions, 1 deletions
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. */