This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
RedBoot - fix BOOTP/DHCP option
- From: Gary Thomas <gary at mlbassoc dot com>
- To: eCos patches <ecos-patches at sources dot redhat dot com>
- Date: 15 Jul 2003 12:52:22 -0600
- Subject: RedBoot - fix BOOTP/DHCP option
- Organization: MLB Associates
Use the correct code/setup for DHCP discovery.
--
Gary Thomas <gary@mlbassoc.com>
MLB Associates
Index: redboot/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/ChangeLog,v
retrieving revision 1.118
diff -u -5 -p -r1.118 ChangeLog
--- redboot/current/ChangeLog 15 Jul 2003 16:21:41 -0000 1.118
+++ redboot/current/ChangeLog 15 Jul 2003 18:50:01 -0000
@@ -1,7 +1,12 @@
2003-07-15 Gary Thomas <gary@mlbassoc.com>
+ * src/net/bootp.c: Use correct options for DHCP discover. This has
+ the added bonus that when BOOTP & GATEWAY options are enabled, then
+ RedBoot can get it's address via normal DHCP. Of course, DHCP leases
+ will be ignored by RedBoot, so some caution is warranted.
+
* include/net/net.h:
* src/net/arp.c (__arp_request): Allow ARP of self - used during
initialization to "broadcast" that an IP address is in use.
* src/net/net_io.c (net_init): When using a static IP, send an
Index: redboot/current/src/net/bootp.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/src/net/bootp.c,v
retrieving revision 1.10
diff -u -5 -p -r1.10 bootp.c
--- redboot/current/src/net/bootp.c 23 Jun 2003 23:42:15 -0000 1.10
+++ redboot/current/src/net/bootp.c 15 Jul 2003 18:48:26 -0000
@@ -68,11 +68,11 @@ extern int net_debug;
static bootp_header_t *bp_info;
#ifdef CYGSEM_REDBOOT_NETWORKING_USE_GATEWAY
static const unsigned char dhcpCookie[] = {99,130,83,99};
static const unsigned char dhcpEndOption[] = {255};
-static const unsigned char dhcpRequestOption[] = {53,1,3};
+static const unsigned char dhcpDiscoverOption[] = {53,1,1};
#endif
static void
bootp_handler(udp_socket_t *skt, char *buf, int len,
ip_route_t *src_route, word src_port)
@@ -167,11 +167,11 @@ __bootp_find_local_ip(bootp_header_t *in
#ifdef CYGSEM_REDBOOT_NETWORKING_USE_GATEWAY
p = b.bp_vend;
AddOption(p,dhcpCookie);
- AddOption(p,dhcpRequestOption);
+ AddOption(p,dhcpDiscoverOption);
AddOption(p,dhcpEndOption);
// Some servers insist on a minimum amount of "vendor" data
if (p < &b.bp_vend[BP_MIN_VEND_SIZE]) p = &b.bp_vend[BP_MIN_VEND_SIZE];
txSize = p - (unsigned char*)&b;