From: Roy Marples Date: Thu, 24 Nov 2016 11:39:59 +0000 (+0000) Subject: Fix size of DHCPv6 addresses when making messages. X-Git-Tag: v6.11.6~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b97c75201c83f16643646e9a4a9e1b2b0c501d76;p=thirdparty%2Fdhcpcd.git Fix size of DHCPv6 addresses when making messages. --- 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: