From: Roy Marples Date: Wed, 5 Jun 2013 17:36:49 +0000 (+0000) Subject: Fix disabled FQDN and allocation X-Git-Tag: v6.0.0~50 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6a99a8102b12ceea45fa7bd7f424346fc9b55141;p=thirdparty%2Fdhcpcd.git Fix disabled FQDN and allocation --- diff --git a/dhcp6.c b/dhcp6.c index ecff6e2d..1de40b2e 100644 --- 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); }