summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-11-10 13:47:46 +0000
committerRoy Marples <roy@marples.name>2016-11-10 13:47:46 +0000
commitf0353a809f889a04857bb18fc356d4a68dda2c9d (patch)
treef9cc990633281ef9ae58b5e27cf06309dee3c56d
parentc7c282d9f7bd63b27e140769a8212d005a6893f7 (diff)
downloaddhcpcd-f0353a809f889a04857bb18fc356d4a68dda2c9d.tar.xz
Fix size of DHCPv6 addresses when making messages.
-rw-r--r--dhcp6.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/dhcp6.c b/dhcp6.c
index 475d5468..50f281c2 100644
--- a/dhcp6.c
+++ b/dhcp6.c
@@ -680,17 +680,14 @@ dhcp6_makemessage(struct interface *ifp)
continue;
if (ap->ia_type == D6_OPTION_IA_PD) {
#ifndef SMALL
- len += sizeof(o) + sizeof(o.len) +
- 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: