]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix disabled FQDN and allocation
authorRoy Marples <roy@marples.name>
Wed, 5 Jun 2013 17:36:49 +0000 (17:36 +0000)
committerRoy Marples <roy@marples.name>
Wed, 5 Jun 2013 17:36:49 +0000 (17:36 +0000)
dhcp6.c

diff --git a/dhcp6.c b/dhcp6.c
index ecff6e2dfe7dd878151df43cbf34b50240fa365a..1de40b2e4f85386e60f391ab2fd9e507ed74be22 100644 (file)
--- a/dhcp6.c
+++ b/dhcp6.c
@@ -380,8 +380,11 @@ dhcp6_makemessage(struct interface *ifp)
                            has_option_mask(ifo->requestmask6, opt->option))
                                len += sizeof(*u16);
                }
-               if (len == 0)
-                       len = sizeof(*u16) * 4;
+               if (len == 0) {
+                       len = sizeof(*u16) * 3;
+                       if (ifo->fqdn != FQDN_DISABLE)
+                               len += sizeof(*u16);
+               }
                len += sizeof(*o);
 
                if (ifo->fqdn != FQDN_DISABLE) {
@@ -614,8 +617,11 @@ dhcp6_makemessage(struct interface *ifp)
                        *u16++ = htons(D6_OPTION_UNICAST);
                        *u16++ = htons(D6_OPTION_DNS_SERVERS);
                        *u16++ = htons(D6_OPTION_DOMAIN_LIST);
-                       *u16++ = htons(D6_OPTION_FQDN);
-                       o->len = sizeof(*u16) * 4;
+                       o->len = sizeof(*u16) * 3;
+                       if (ifo->fqdn != FQDN_DISABLE) {
+                               *u16++ = htons(D6_OPTION_FQDN);
+                               o->len += sizeof(*u16);
+                       }
                }
                o->len = htons(o->len);
        }