]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix size of DHCPv6 addresses when making messages.
authorRoy Marples <roy@marples.name>
Thu, 24 Nov 2016 11:39:59 +0000 (11:39 +0000)
committerRoy Marples <roy@marples.name>
Thu, 24 Nov 2016 11:39:59 +0000 (11:39 +0000)
dhcp6.c

diff --git a/dhcp6.c b/dhcp6.c
index 6e35a9fc399a5933a392e62cbaae7d08286c0e5c..fd0990324768a757b4e14a4ab9098137740c3539 100644 (file)
--- 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: