changeset 2198:a27494b93e8e draft

Fix sending of DHCPv6 FQDN when only hostname specified
author Roy Marples <roy@marples.name>
date Tue, 10 Dec 2013 13:15:19 +0000
parents 0599335f7a36
children bb26f6bc07fc
files dhcp6.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/dhcp6.c	Tue Dec 10 12:28:38 2013 +0000
+++ b/dhcp6.c	Tue Dec 10 13:15:19 2013 +0000
@@ -375,12 +375,13 @@
 	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);