]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - net/bootp.c
DHCP Client Fix
[karo-tx-uboot.git] / net / bootp.c
index 749d3e5e0c24ce08fb3ea7f9ccc8726b56445ed8..cfe6f8dd6b9276ce8f73e1542b43a02e89f6a218 100644 (file)
@@ -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;
@@ -980,3 +982,4 @@ void DhcpRequest(void)
 #endif
 
 #endif
+