summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-11-24 11:39:59 +0000
committerRoy Marples <roy@marples.name>2016-11-24 11:39:59 +0000
commitb97c75201c83f16643646e9a4a9e1b2b0c501d76 (patch)
treef0a3c44e5fe6a132f873fa2a29c49e5fa5e113f3
parenta2d467862af19bdf8f3889d11111f7e7dee63ed6 (diff)
downloaddhcpcd-b97c75201c83f16643646e9a4a9e1b2b0c501d76.tar.xz
Fix size of DHCPv6 addresses when making messages.
-rw-r--r--dhcp6.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/dhcp6.c b/dhcp6.c
index 6e35a9fc..fd099032 100644
--- a/dhcp6.c
+++ b/dhcp6.c
@@ -640,17 +640,16 @@ dhcp6_makemessage(struct interface *ifp)
continue;
if (ap->ia_type == D6_OPTION_IA_PD) {
#ifndef SMALL
- len += sizeof(*o) + sizeof(u8) +
- sizeof(u32) + sizeof(u32) +
- sizeof(ap->prefix);
+ len += sizeof(*o) +
+ sizeof(struct dhcp6_pd_addr);
if (ap->prefix_exclude_len)
len += sizeof(*o) + 1 +
(uint8_t)((ap->prefix_exclude_len -
ap->prefix_len - 1) / NBBY) + 1;
#endif
} else
- len += sizeof(*o) + sizeof(ap->addr) +
- sizeof(u32) + sizeof(u32);
+ len += sizeof(*o) +
+ sizeof(struct dhcp6_ia_addr);
}
/* FALLTHROUGH */
case DH6S_INIT: