]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix sending of DHCPv6 FQDN when only hostname specified
authorRoy Marples <roy@marples.name>
Tue, 10 Dec 2013 13:15:19 +0000 (13:15 +0000)
committerRoy Marples <roy@marples.name>
Tue, 10 Dec 2013 13:15:19 +0000 (13:15 +0000)
dhcp6.c

diff --git a/dhcp6.c b/dhcp6.c
index b135273479c3354f5047d6e87a09ede30b4964f5..330ba6a5f54f7fcba2d35760340bb2fe290d0da0 100644 (file)
--- a/dhcp6.c
+++ b/dhcp6.c
@@ -375,12 +375,13 @@ dhcp6_makemessage(struct interface *ifp)
        ifo = ifp->options;
        fqdn = ifo->fqdn;
 
-       if (fqdn == FQDN_DISABLE || ifo->options & DHCPCD_HOSTNAME) {
+       if (fqdn == FQDN_DISABLE && ifo->options & DHCPCD_HOSTNAME) {
                /* We're sending the DHCPv4 hostname option, so send FQDN as
                 * DHCPv6 has no FQDN option and DHCPv4 must not send
                 * hostname and FQDN according to RFC4702 */
-               if (fqdn == FQDN_DISABLE)
-                       fqdn = FQDN_BOTH;
+               fqdn = FQDN_BOTH;
+       }
+       if (fqdn != FQDN_DISABLE) {
                if (ifo->hostname[0] == '\0')
                        hostname = get_hostname(ifo->options &
                            DHCPCD_HOSTNAME_SHORT ? 1 : 0);