Subject: | DHCPV6 option 39 containing spaces is not correctly handled by server |
The inability to correctly handle DHCPv6 packets containing FQDN options whose domain name contains spaces is a bug, not something done intentionally.
Reported by Bluecat 10738:
When the server unpacks the FQDN option from a DHCPv6 client packet, it attempts to convert the name portion to its printable form. Spaces are converted from 1 byte (0x20) to four characters, "\\032". The calculation used to allocate a buffer large enough to store the printable form does not take this expansion into account and thus allocates too small a buffer, causing the subsequent conversion to fail.
The server handles FQDN options under DHCPv4 differently. Rather than convert them to printable form when unpacking them, it stores them in DNS encoded form. If the received option is not already encoded, the server encodes it first.
The v6 code needs to be corrected to properly handle the conversion. The function, common/options.c:fqdn6_universe_decode does the buffer sizing and allocation and then calls MRns_name_ntop() to do the conversion.