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

diff --git a/dhcp6.c b/dhcp6.c
index 475d546873402500499b80ad0cf1c6f6aa9bdf36..50f281c2ec59d9f654f28a36159da6b8646aec64 100644 (file)
--- 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: