Index: src/core/dhcp.c
===================================================================
RCS file: /sources/lwip/lwip/src/core/dhcp.c,v
retrieving revision 1.59
diff -u -3 -p -r1.59 dhcp.c
--- src/core/dhcp.c	1 Dec 2006 13:52:07 -0000	1.59
+++ src/core/dhcp.c	23 Mar 2007 13:38:56 -0000
@@ -217,6 +217,9 @@ static err_t dhcp_select(struct netif *n
   struct dhcp *dhcp = netif->dhcp;
   err_t result;
   u32_t msecs;
+#if LWIP_DHCP_HOSTNAME_LENGTH
+  const char *p;
+#endif
   LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE | 3, ("dhcp_select(netif=%p) %c%c%"U16_F"\n", (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num));
 
   /* create and initialize the DHCP message header */
@@ -242,6 +245,14 @@ static err_t dhcp_select(struct netif *n
     dhcp_option_byte(dhcp, DHCP_OPTION_BROADCAST);
     dhcp_option_byte(dhcp, DHCP_OPTION_DNS_SERVER);
 
+#if LWIP_DHCP_HOSTNAME_LENGTH
+    p = ( const char *)LWIP_DHCP_HOSTNAME;
+    dhcp_option(dhcp, DHCP_OPTION_HOSTNAME, LWIP_DHCP_HOSTNAME_LENGTH);
+    while( *p) {
+      dhcp_option_byte(dhcp, *p++);
+	}
+#endif
+
     dhcp_option_trailer(dhcp);
     /* shrink the pbuf to the actual content length */
     pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len);


Index: src/include/lwip/dhcp.h
===================================================================
RCS file: /sources/lwip/lwip/src/include/lwip/dhcp.h,v
retrieving revision 1.20
diff -u -3 -p -r1.20 dhcp.h
--- src/include/lwip/dhcp.h	4 Nov 2004 19:19:29 -0000	1.20
+++ src/include/lwip/dhcp.h	23 Mar 2007 13:37:51 -0000
@@ -8,6 +8,10 @@
 #include "lwip/netif.h"
 #include "lwip/udp.h"
 
+#if !defined( LWIP_DHCP_HOSTNAME_LENGTH)
+#define LWIP_DHCP_HOSTNAME_LENGTH 0
+#endif
+
 /** period (in seconds) of the application calling dhcp_coarse_tmr() */
 #define DHCP_COARSE_TIMER_SECS 60 
 /** period (in milliseconds) of the application calling dhcp_fine_tmr() */
@@ -210,6 +214,7 @@ void dhcp_fine_tmr(void);
 
 #define DHCP_OPTION_T1 58 /* T1 renewal time */
 #define DHCP_OPTION_T2 59 /* T2 rebinding time */
+#define DHCP_OPTION_US 60
 #define DHCP_OPTION_CLIENT_ID 61
 #define DHCP_OPTION_TFTP_SERVERNAME 66
 #define DHCP_OPTION_BOOTFILE 67
