summaryrefslogtreecommitdiffstats
path: root/net/bootp.c
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2007-12-11 11:34:54 +0100
committerStefan Roese <sr@denx.de>2007-12-11 11:34:54 +0100
commit9caeaadf508cd0e11ac5dfc56ab0f72e3b89a105 (patch)
tree1afcc9c20c04e19870ab5e2996104877695c54a3 /net/bootp.c
parent7cfc12a7dcfdb350e2ab76db4dafcc30f7e77c2b (diff)
parent41be969f4957115ed7b1fe8b890bfaee99d7a7a2 (diff)
downloadblackbird-obmc-uboot-9caeaadf508cd0e11ac5dfc56ab0f72e3b89a105.tar.gz
blackbird-obmc-uboot-9caeaadf508cd0e11ac5dfc56ab0f72e3b89a105.zip
Merge commit 'u-boot/master' into for-1.3.1
Conflicts: drivers/rtc/Makefile
Diffstat (limited to 'net/bootp.c')
-rw-r--r--net/bootp.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/net/bootp.c b/net/bootp.c
index 749d3e5e0c..89e30d2c70 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -33,7 +33,7 @@
#if defined(CONFIG_CMD_NET)
-#define TIMEOUT 5 /* Seconds before trying BOOTP again */
+#define TIMEOUT 5UL /* Seconds before trying BOOTP again */
#ifndef CONFIG_NET_RETRY_COUNT
# define TIMEOUT_COUNT 5 /* # of timeouts before giving up */
#else
@@ -850,9 +850,9 @@ static void DhcpSendRequestPkt(Bootp_t *bp_offer)
bp->bp_hlen = HWL_ETHER;
bp->bp_hops = 0;
bp->bp_secs = htons(get_timer(0) / CFG_HZ);
- NetCopyIP(&bp->bp_ciaddr, &bp_offer->bp_ciaddr); /* both in network byte order */
- NetCopyIP(&bp->bp_yiaddr, &bp_offer->bp_yiaddr);
- NetCopyIP(&bp->bp_siaddr, &bp_offer->bp_siaddr);
+ /* Do not set the client IP, your IP, or server IP yet, since it hasn't been ACK'ed by
+ * the server yet */
+
/*
* RFC3046 requires Relay Agents to discard packets with
* nonzero and offered giaddr
@@ -870,7 +870,9 @@ static void DhcpSendRequestPkt(Bootp_t *bp_offer)
/*
* Copy options from OFFER packet if present
*/
- NetCopyIP(&OfferedIP, &bp->bp_yiaddr);
+
+ /* Copy offered IP into the parameters request list */
+ NetCopyIP(&OfferedIP, &bp_offer->bp_yiaddr);
extlen = DhcpExtended((u8 *)bp->bp_vend, DHCP_REQUEST, NetDHCPServerIP, OfferedIP);
pktlen = BOOTP_SIZE - sizeof(bp->bp_vend) + extlen;
@@ -977,6 +979,6 @@ void DhcpRequest(void)
{
BootpRequest();
}
-#endif
+#endif /* CONFIG_CMD_DHCP */
-#endif
+#endif /* CONFIG_CMD_NET */
OpenPOWER on IntegriCloud