[U-Boot-Users] [Patch] DHCP via relay

Borsodi Petr Petr.Borsodi at i.cz
Sat Jan 21 18:45:36 CET 2006


Hi,

I am using u-boot 1.1.4 and I discover a problem with DHCP via DHCP
Relay. I think that u-boot incorrectly sets some fields in DHCP Request
packet. See RFC 2131, chapter 4.4.

CHANGELOG:
 * Fix DHCP support (DHCP Relay problem)
   Patch by Petr Borsodi, 21 Jan 2006

diff -uprN u-boot-1.1.4/net/bootp.c u-boot-1.1.4-dhcp/net/bootp.c
--- u-boot-1.1.4/net/bootp.c	2005-12-16 17:39:27.000000000 +0100
+++ u-boot-1.1.4-dhcp/net/bootp.c	2006-01-02 08:51:22.000000000
+0100
@@ -820,10 +820,10 @@ static void DhcpSendRequestPkt(Bootp_t *
 	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);
-	NetCopyIP(&bp->bp_giaddr, &bp_offer->bp_giaddr);
+	NetCopyIP(&bp->bp_ciaddr, &NetOurIP);
+	NetWriteIP(&bp->bp_yiaddr, 0);
+	NetWriteIP(&bp->bp_siaddr, 0);
+	NetWriteIP(&bp->bp_giaddr, 0);
 	memcpy (bp->bp_chaddr, NetOurEther, 6);
 
 	/*


Petr Borsodi




More information about the U-Boot mailing list