From f0353a809f889a04857bb18fc356d4a68dda2c9d Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Thu, 10 Nov 2016 13:47:46 +0000 Subject: [PATCH] Fix size of DHCPv6 addresses when making messages. --- dhcp6.c | 7 ++----- 1 file 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: -- 2.47.2