summaryrefslogtreecommitdiffstats
path: root/src/ipv6nd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-05-05 19:03:49 +0000
committerRoy Marples <roy@marples.name>2020-05-05 19:03:49 +0000
commit032bb2e172c77dee0aaa49f625043598f117e915 (patch)
treeb619211829fb48f9eda1a40c1c71f6ce54baf0a2 /src/ipv6nd.c
parent5a3fd90a17d8c0cda02dd4ca590f29acf5912d83 (diff)
downloaddhcpcd-032bb2e172c77dee0aaa49f625043598f117e915.tar.xz
DHCP: Use correct buffer for receiving UDP
Big wup! While here, ensure buffer is aligned to the structure we want to read.
Diffstat (limited to 'src/ipv6nd.c')
-rw-r--r--src/ipv6nd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ipv6nd.c b/src/ipv6nd.c
index 73df9109..ae267c7a 100644
--- a/src/ipv6nd.c
+++ b/src/ipv6nd.c
@@ -1937,10 +1937,12 @@ ipv6nd_handledata(void *arg)
struct dhcpcd_ctx *ctx;
int fd;
struct sockaddr_in6 from;
- unsigned char buf[64 * 1024]; /* Maximum ICMPv6 size */
+ union {
+ struct icmp6_hdr hdr;
+ uint8_t buf[64 * 1024]; /* Maximum ICMPv6 size */
+ } iovbuf;
struct iovec iov = {
- .iov_base = buf,
- .iov_len = sizeof(buf),
+ .iov_base = iovbuf.buf, .iov_len = sizeof(iovbuf.buf),
};
union {
struct cmsghdr hdr;