summaryrefslogtreecommitdiff
path: root/net/bootp.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2009-06-15 11:15:54 +0200
committerWolfgang Denk <wd@denx.de>2009-06-15 11:15:54 +0200
commitc9005a72fee4231e30fe93c1741cea2342c54504 (patch)
tree50ae6edb28698df98211f99a8178f06a8b7ab50f /net/bootp.c
parent9ff67e5e4c719556d57f136a6453f8e4798d85c0 (diff)
parent60f61e6d7655400bb785a2ef637581679941f6d1 (diff)
downloadu-boot-imx-c9005a72fee4231e30fe93c1741cea2342c54504.zip
u-boot-imx-c9005a72fee4231e30fe93c1741cea2342c54504.tar.gz
u-boot-imx-c9005a72fee4231e30fe93c1741cea2342c54504.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-net
Diffstat (limited to 'net/bootp.c')
-rw-r--r--net/bootp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/bootp.c b/net/bootp.c
index 3dea70aa..77057c6 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -687,7 +687,7 @@ BootpRequest (void)
* Calculate proper packet lengths taking into account the
* variable size of the options field
*/
- pktlen = BOOTP_SIZE - sizeof(bp->bp_vend) + ext_len;
+ pktlen = ((int)(pkt-NetTxPacket)) + BOOTP_HDR_SIZE - sizeof(bp->bp_vend) + ext_len;
iplen = BOOTP_HDR_SIZE - sizeof(bp->bp_vend) + ext_len;
NetSetIP(iphdr, 0xFFFFFFFFL, PORT_BOOTPS, PORT_BOOTPC, iplen);
NetSetTimeout(SELECT_TIMEOUT, BootpTimeout);
@@ -860,7 +860,7 @@ static void DhcpSendRequestPkt(Bootp_t *bp_offer)
NetCopyIP(&OfferedIP, &bp_offer->bp_yiaddr);
extlen = DhcpExtended((u8 *)bp->bp_vend, DHCP_REQUEST, NetDHCPServerIP, OfferedIP);
- pktlen = BOOTP_SIZE - sizeof(bp->bp_vend) + extlen;
+ pktlen = ((int)(pkt-NetTxPacket)) + BOOTP_HDR_SIZE - sizeof(bp->bp_vend) + extlen;
iplen = BOOTP_HDR_SIZE - sizeof(bp->bp_vend) + extlen;
NetSetIP(iphdr, 0xFFFFFFFFL, PORT_BOOTPS, PORT_BOOTPC, iplen);