[U-Boot] [PATCH 1/1] net:Fix potential empty DHCP Parameter Request List
Jason Liu
r64343 at freescale.com
Fri Oct 22 10:36:25 CEST 2010
From: Gray Remlin <g_remlin at rocketmail.com>
Can't get IP address with dhcp due to the dhcp server not
allow the empty param list request under some network env
Signed-off-by: Gray Remlin <g_remlin at rocketmail.com>
Signed-off-by: Jason Liu <r64343 at freescale.com>
---
net/bootp.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/net/bootp.c b/net/bootp.c
index e679f8b..c87d0c2 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -417,9 +417,19 @@ static int DhcpExtended (u8 * e, int message_type, IPaddr_t ServerID, IPaddr_t R
return x - start;
#endif
+#if defined(CONFIG_BOOTP_SUBNETMASK) || \
+ defined(CONFIG_BOOTP_TIMEOFFSET) || \
+ defined(CONFIG_BOOTP_GATEWAY) || \
+ defined(CONFIG_BOOTP_DNS) || \
+ defined(CONFIG_BOOTP_HOSTNAME) || \
+ defined(CONFIG_BOOTP_BOOTFILESIZE) || \
+ defined(CONFIG_BOOTP_BOOTPATH) || \
+ defined(CONFIG_BOOTP_NISDOMAIN) || \
+ defined(CONFIG_BOOTP_NTPSERVER)
*e++ = 55; /* Parameter Request List */
cnt = e++; /* Pointer to count of requested items */
*cnt = 0;
+#endif
#if defined(CONFIG_BOOTP_SUBNETMASK)
*e++ = 1; /* Subnet Mask */
*cnt += 1;
--
1.7.0.4
More information about the U-Boot
mailing list