select.c (d04ccbb3) | select.c (f4b3ec61) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 155 unchanged lines hidden (view full) --- 164 /* 165 * The max DHCP message size option is set to the interface 166 * MTU, minus the size of the UDP and IP headers. 167 */ 168 (void) add_pkt_opt16(dpkt, CD_MAX_DHCP_SIZE, 169 htons(dsmp->dsm_lif->lif_max - sizeof (struct udpiphdr))); 170 (void) add_pkt_opt32(dpkt, CD_LEASE_TIME, htonl(DHCP_PERM)); 171 | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 155 unchanged lines hidden (view full) --- 164 /* 165 * The max DHCP message size option is set to the interface 166 * MTU, minus the size of the UDP and IP headers. 167 */ 168 (void) add_pkt_opt16(dpkt, CD_MAX_DHCP_SIZE, 169 htons(dsmp->dsm_lif->lif_max - sizeof (struct udpiphdr))); 170 (void) add_pkt_opt32(dpkt, CD_LEASE_TIME, htonl(DHCP_PERM)); 171 |
172 (void) add_pkt_opt(dpkt, CD_CLASS_ID, class_id, class_id_len); | 172 if (class_id_len != 0) { 173 (void) add_pkt_opt(dpkt, CD_CLASS_ID, class_id, 174 class_id_len); 175 } |
173 (void) add_pkt_prl(dpkt, dsmp); 174 175 if (df_get_bool(dsmp->dsm_name, dsmp->dsm_isv6, 176 DF_REQUEST_HOSTNAME)) { 177 dhcpmsg(MSG_DEBUG, 178 "dhcp_selecting: DF_REQUEST_HOSTNAME"); 179 (void) snprintf(hostfile, sizeof (hostfile), 180 "/etc/hostname.%s", dsmp->dsm_name); --- 94 unchanged lines hidden (view full) --- 275 if (!dsmp->dsm_using_dlpi) { 276 dhcpmsg(MSG_VERBOSE, "dhcp_collect_dlpi: ignore state " 277 "machine for %s packet XID %#x received via DLPI on %s", 278 pname, xid, pif->pif_name); 279 free_pkt_entry(plp); 280 return; 281 } 282 | 176 (void) add_pkt_prl(dpkt, dsmp); 177 178 if (df_get_bool(dsmp->dsm_name, dsmp->dsm_isv6, 179 DF_REQUEST_HOSTNAME)) { 180 dhcpmsg(MSG_DEBUG, 181 "dhcp_selecting: DF_REQUEST_HOSTNAME"); 182 (void) snprintf(hostfile, sizeof (hostfile), 183 "/etc/hostname.%s", dsmp->dsm_name); --- 94 unchanged lines hidden (view full) --- 278 if (!dsmp->dsm_using_dlpi) { 279 dhcpmsg(MSG_VERBOSE, "dhcp_collect_dlpi: ignore state " 280 "machine for %s packet XID %#x received via DLPI on %s", 281 pname, xid, pif->pif_name); 282 free_pkt_entry(plp); 283 return; 284 } 285 |
283 if (pkt_v4_match(recv_type, DHCP_PACK | DHCP_PNAK)) { | 286 if (pkt_v4_match(recv_type, DHCP_PACK)) { |
284 if (!dhcp_bound(dsmp, plp)) { 285 dhcpmsg(MSG_WARNING, "dhcp_collect_dlpi: dhcp_bound " 286 "failed for %s", dsmp->dsm_name); 287 dhcp_restart(dsmp); 288 return; 289 } 290 dhcpmsg(MSG_VERBOSE, "dhcp_collect_dlpi: %s on %s", 291 pname, dsmp->dsm_name); | 287 if (!dhcp_bound(dsmp, plp)) { 288 dhcpmsg(MSG_WARNING, "dhcp_collect_dlpi: dhcp_bound " 289 "failed for %s", dsmp->dsm_name); 290 dhcp_restart(dsmp); 291 return; 292 } 293 dhcpmsg(MSG_VERBOSE, "dhcp_collect_dlpi: %s on %s", 294 pname, dsmp->dsm_name); |
295 } else if (pkt_v4_match(recv_type, DHCP_PNAK)) { 296 free_pkt_entry(plp); 297 dhcp_restart(dsmp); |
|
292 } else { 293 pkt_smach_enqueue(dsmp, plp); 294 } 295} 296 297/* 298 * stop_selecting(): decides when to stop retransmitting DISCOVERs -- only when 299 * abandoning the state machine. For DHCPv6, this timer may --- 29 unchanged lines hidden --- | 298 } else { 299 pkt_smach_enqueue(dsmp, plp); 300 } 301} 302 303/* 304 * stop_selecting(): decides when to stop retransmitting DISCOVERs -- only when 305 * abandoning the state machine. For DHCPv6, this timer may --- 29 unchanged lines hidden --- |