From: Roy Marples Date: Thu, 10 Nov 2016 13:47:46 +0000 (+0000) Subject: Fix size of DHCPv6 addresses when making messages. X-Git-Tag: v7.0.0-beta1~117 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0353a809f889a04857bb18fc356d4a68dda2c9d;p=thirdparty%2Fdhcpcd.git Fix size of DHCPv6 addresses when making messages. --- 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: