Print this page
7388 Support DHCP Client FQDN. Allow IAID/DUID for all v4.
@@ -19,10 +19,11 @@
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016, Chris Fraire <cfraire@me.com>.
*
* REQUESTING state of the client state machine.
*/
#include <stdlib.h>
@@ -77,10 +78,13 @@
sizeof (d6in) - sizeof (dhcpv6_option_t));
/* Add required Option Request option */
(void) add_pkt_prl(dpkt, dsmp);
+ /* Add FQDN if configured */
+ (void) dhcp_add_fqdn_opt(dpkt, dsmp);
+
(void) send_pkt_v6(dsmp, dpkt, dsmp->dsm_server, stop_requesting,
DHCPV6_REQ_TIMEOUT, DHCPV6_REQ_MAX_RT);
/* For DHCPv6, state switch cannot fail */
(void) set_smach_state(dsmp, REQUESTING);
@@ -311,11 +315,12 @@
/*
* dsm_reqhost was set for this state machine in
* dhcp_selecting() if the DF_REQUEST_HOSTNAME option set and a
* host name was found
*/
- if (dsmp->dsm_reqhost != NULL) {
+ if (dhcp_add_fqdn_opt(dpkt, dsmp) != 0 &&
+ dsmp->dsm_reqhost != NULL) {
(void) add_pkt_opt(dpkt, CD_HOSTNAME, dsmp->dsm_reqhost,
strlen(dsmp->dsm_reqhost));
}
(void) add_pkt_opt(dpkt, CD_END, NULL, 0);