From 31548249decf18a6b877a18436b6139dd483fe4a Mon Sep 17 00:00:00 2001 From: Justin Flammia Date: Mon, 29 Oct 2007 17:40:35 -0400 Subject: DHCP Client Fix This is a multi-part message in MIME format. commit e6e505eae94ed721e123e177489291fc4544b7b8 Author: Justin Flammia Date: Mon Oct 29 17:19:03 2007 -0400 Found a bug in the way the DHCP Request packet is built, where the IP address that is offered by the server is bound to prematurely. This patch is a fix of that bug where the IP address offered by the DHCP server is not used until after the DHCP ACK from the server is received. Signed-off-by: Justin Flammia Signed-off-by: Ben Warren --- net/bootp.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'net') diff --git a/net/bootp.c b/net/bootp.c index 749d3e5..cfe6f8d 100644 --- a/net/bootp.c +++ b/net/bootp.c @@ -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 + -- cgit v1.1 From 1f103105a3746ab12279b63b8c1d372c0ce2cc58 Mon Sep 17 00:00:00 2001 From: Roy Zang Date: Mon, 5 Nov 2007 17:39:24 +0800 Subject: Implement general ULi 526x Ethernet driver support in U-boot This patch implements general ULi 526x Ethernet driver. Until now, it is the only native Ethernet port on MPC8610HPCD board, but it could be used on other boards with ULi 526x Ethernet port as well. Signed-off-by: Roy Zang Signed-off-by: Zhang Wei Acked-by: Jon Loeliger Signed-off-by: Ben Warren --- net/eth.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'net') diff --git a/net/eth.c b/net/eth.c index e7f1220..1b56a35 100644 --- a/net/eth.c +++ b/net/eth.c @@ -54,6 +54,7 @@ extern int rtl8169_initialize(bd_t*); extern int scc_initialize(bd_t*); extern int skge_initialize(bd_t*); extern int tsi108_eth_initialize(bd_t*); +extern int uli526x_initialize(bd_t *); extern int tsec_initialize(bd_t*, int, char *); extern int npe_initialize(bd_t *); extern int uec_initialize(int); @@ -238,6 +239,9 @@ int eth_initialize(bd_t *bis) #if defined(CONFIG_TSI108_ETH) tsi108_eth_initialize(bis); #endif +#if defined(CONFIG_ULI526X) + uli526x_initialize(bis); +#endif #if defined(CONFIG_RTL8139) rtl8139_initialize(bis); #endif -- cgit v1.1