before an ack response is required.
The default TFTP implementation implies a window size of 1.
+config SERVERIP_FROM_PROXYDHCP
+ bool "Get serverip value from Proxy DHCP response"
+ help
+ Allows bootfile config to be fetched from Proxy DHCP server
+ while IP is obtained from main DHCP server.
+
+config SERVERIP_FROM_PROXYDHCP_DELAY_MS
+ int "# of additional milliseconds to wait for ProxyDHCP response"
+ default 100
+ help
+ Amount of additional time to wait for ProxyDHCP response after
+ receiving response from main DHCP server. Has no effect if
+ SERVERIP_FROM_PROXYDHCP is false.
+
endif # if NET
return retval;
}
-/*
- * Copy parameters of interest from BOOTP_REPLY/DHCP_OFFER packet
- */
-static void store_net_params(struct bootp_hdr *bp)
+static void store_bootp_params(struct bootp_hdr *bp)
{
#if !defined(CONFIG_BOOTP_SERVERIP)
struct in_addr tmp_ip;
*/
if (*net_boot_file_name)
env_set("bootfile", net_boot_file_name);
+#endif
+}
+
+/*
+ * Copy parameters of interest from BOOTP_REPLY/DHCP_OFFER packet
+ */
+static void store_net_params(struct bootp_hdr *bp)
+{
+#if !defined(CONFIG_SERVERIP_FROM_PROXYDHCP)
+ store_bootp_params(bp);
#endif
net_copy_ip(&net_ip, &bp->bp_yiaddr);
}
debug("DHCPHandler: got DHCP packet: (src=%d, dst=%d, len=%d) state: "
"%d\n", src, dest, len, dhcp_state);
- if (net_read_ip(&bp->bp_yiaddr).s_addr == 0)
+ if (net_read_ip(&bp->bp_yiaddr).s_addr == 0) {
+#if defined(CONFIG_SERVERIP_FROM_PROXYDHCP)
+ store_bootp_params(bp);
+#endif
return;
+ }
switch (dhcp_state) {
case SELECTING:
dhcp_packet_process_options(bp);
efi_net_set_dhcp_ack(pkt, len);
+#if defined(CONFIG_SERVERIP_FROM_PROXYDHCP)
+ if (!net_server_ip.s_addr)
+ udelay(CONFIG_SERVERIP_FROM_PROXYDHCP_DELAY_MS *
+ 1000);
+#endif /* CONFIG_SERVERIP_FROM_PROXYDHCP */
+
debug("TRANSITIONING TO REQUESTING STATE\n");
dhcp_state = REQUESTING;