Newer
Older
* Wait an appropriate time for any potential DHCPOFFER packets
* to arrive. Then select one, and generate DHCPREQUEST
* response. If filename is in format we recognize, assume it
* is a valid OFFER from a server we want.
debug("DHCP: state=SELECTING bp_file: \"%s\"\n", bp->bp_file);
#ifdef CONFIG_SYS_BOOTFILE_PREFIX
CONFIG_SYS_BOOTFILE_PREFIX,
strlen(CONFIG_SYS_BOOTFILE_PREFIX)) == 0) {
#endif /* CONFIG_SYS_BOOTFILE_PREFIX */
dhcp_packet_process_options(bp);
debug("TRANSITIONING TO REQUESTING STATE\n");
Stefan Roese
committed
net_set_timeout_handler(5000, bootp_timeout_handler);
dhcp_send_request_packet(bp);
#ifdef CONFIG_SYS_BOOTFILE_PREFIX
#endif /* CONFIG_SYS_BOOTFILE_PREFIX */
if (dhcp_message_type((u8 *)bp->bp_vend) == DHCP_ACK) {
dhcp_packet_process_options(bp);
/* Store net params from reply */
store_net_params(bp);
printf("DHCP client bound to address %pI4 (%lu ms)\n",
&net_ip, get_timer(bootp_start));
net_set_timeout_handler(0, (thand_f *)0);
bootstage_mark_name(BOOTSTAGE_ID_BOOTP_STOP,
case BOUND:
/* DHCP client bound to address */
break;
puts("DHCP: INVALID STATE\n");
void dhcp_request(void)
bootp_request();