diff -r -u5 -N -x CVS ecos_orig/packages/net/bsd_tcpip/current/ChangeLog ecos_dev/packages/net/bsd_tcpip/current/ChangeLog
--- ecos_orig/packages/net/bsd_tcpip/current/ChangeLog	2006-05-19 11:15:03.000000000 +0100
+++ ecos_dev/packages/net/bsd_tcpip/current/ChangeLog	2006-06-14 14:26:19.265625000 +0100
@@ -1,5 +1,10 @@
+2006-06-14  Andy Jackson <andy@xylanta.com>
+
+	* cdl/freebsd_net.cdl, src/ecos/support.c, src/ecos/support.c:
+	Changes to make stack sizes CDL configurable.
+
 2006-05-19  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* tests/sysctl1.c: Use CYG_NELEM from infra. 
 
 2006-05-08  Andy Jackson <andy@grapevinetech.co.uk>
diff -r -u5 -N -x CVS ecos_orig/packages/net/bsd_tcpip/current/cdl/freebsd_net.cdl ecos_dev/packages/net/bsd_tcpip/current/cdl/freebsd_net.cdl
--- ecos_orig/packages/net/bsd_tcpip/current/cdl/freebsd_net.cdl	2005-03-12 12:55:46.000000000 +0000
+++ ecos_dev/packages/net/bsd_tcpip/current/cdl/freebsd_net.cdl	2006-06-14 14:19:15.421875000 +0100
@@ -318,11 +318,11 @@
         description   "
             Clusters size."
     }
 
     cdl_option CYGPKG_NET_MAXSOCKETS {
-        display "Max number of open sockets."
+        display "Max number of open sockets"
         flavor  data
         default_value CYGNUM_FILEIO_NFILE
         description   "
             This option controls the amount of memory pre-allocated
         for socket buffers used by the networking code."
@@ -335,35 +335,67 @@
         description   "
             This option controls the number of pending network events
         used by the networking code."
     }
 
-    cdl_option CYGPKG_NET_THREAD_PRIORITY {
-        display "Priority level for backgound network processing."
-        flavor  data
-        default_value 7
-        description   "
-            This option allows the thread priority level used by the
-        networking stack to be adjusted by the user.  It should be set
-        high enough that sufficient CPU resources are available to
-        process network data, but may be adjusted so that application
-        threads can have precedence over network processing."
+    cdl_component CYGPKG_NET_THREAD {
+        display        "Background network processing thread options"
+        flavor        none
+        no_define
+
+     cdl_option CYGPKG_NET_THREAD_PRIORITY {
+            display "Priority level for background network processing"
+            flavor  data
+            default_value 7
+            description   "
+                This option allows the thread priority level used by the
+            networking stack to be adjusted by the user.  It should be set
+            high enough that sufficient CPU resources are available to
+            process network data, but may be adjusted so that application
+            threads can have precedence over network processing."
+        }
+
+        cdl_option CYGNUM_NET_THREAD_STACKSIZE {
+            display "Stack size for backgound network processing"
+            flavor  data
+            default_value 0
+            description   "
+                This option allows the thread stack allocated for the
+            networking stack to be adjusted by the user. A value of 0
+            will use the default size."
+        }
     }
 
-    cdl_option CYGPKG_NET_FAST_THREAD_PRIORITY {
-        display "Priority level for fast network processing."
-        flavor  data
-        default_value CYGPKG_NET_THREAD_PRIORITY - 1
-        description   "
-            This option sets the thread priority level used by the fast
-        network thread.  The fast network thread runs often but briefly, to
-        service network device interrupts and network timeout events.  This
-        thread should have higher priority than the background network
-        thread.  It is reasonable to set this thread's priority higher than
-        application threads for best network throughput, or to set it lower
-        than application threads for best latency for those application
-        threads themselves, potentially at a cost to network throughput."
+    cdl_component CYGPKG_NET_FAST_THREAD {
+        display       "Fast network processing thread options"
+        flavor        none
+        no_define
+
+        cdl_option CYGPKG_NET_FAST_THREAD_PRIORITY {
+            display       "Priority level for fast network processing"
+            flavor        data
+            default_value CYGPKG_NET_THREAD_PRIORITY - 1
+            description   "
+                This option sets the thread priority level used by the fast
+            network thread.  The fast network thread runs often but briefly, to
+            service network device interrupts and network timeout events.  This
+            thread should have higher priority than the background network
+            thread.  It is reasonable to set this thread's priority higher than
+            application threads for best network throughput, or to set it lower
+            than application threads for best latency for those application
+            threads themselves, potentially at a cost to network throughput."
+        }
+
+        cdl_option CYGNUM_NET_FAST_THREAD_STACKSIZE {
+            display       "Stack size for fast network processing"
+            flavor        data
+            default_value 0
+            description   "
+                This option allows the thread stack allocated for the
+            fast networking stack to be adjusted by the user. A value
+            of 0 will use the default size."
+        }
     }
 
     cdl_component CYGPKG_NET_FAST_THREAD_TICKLE_DEVS {
         display "Fast network processing thread 'tickles' drivers"
         default_value 1
diff -r -u5 -N -x CVS ecos_orig/packages/net/bsd_tcpip/current/src/ecos/support.c ecos_dev/packages/net/bsd_tcpip/current/src/ecos/support.c
--- ecos_orig/packages/net/bsd_tcpip/current/src/ecos/support.c	2006-05-08 18:21:37.000000000 +0100
+++ ecos_dev/packages/net/bsd_tcpip/current/src/ecos/support.c	2006-06-14 14:19:15.484375000 +0100
@@ -102,15 +102,22 @@
 // Low-level network debugging & logging
 #ifdef CYGPKG_NET_FREEBSD_LOGGING
 int cyg_net_log_mask = CYGPKG_NET_FREEBSD_LOGGING;
 #endif
 
+#if defined(CYGNUM_NET_THREAD_STACKSIZE) && CYGNUM_NET_THREAD_STACKSIZE != 0
+// Use CDL set stack size
+#define STACK_SIZE CYGNUM_NET_THREAD_STACKSIZE
+#else
+// Use default stack sizes
 #ifdef CYGPKG_NET_INET6
 #define STACK_SIZE (CYGNUM_HAL_STACK_SIZE_TYPICAL+2048)
 #else
 #define STACK_SIZE CYGNUM_HAL_STACK_SIZE_TYPICAL
 #endif
+#endif
+
 static char netint_stack[STACK_SIZE];
 static cyg_thread netint_thread_data;
 static cyg_handle_t netint_thread_handle;
 
 cyg_flag_t netint_flags;  
diff -r -u5 -N -x CVS ecos_orig/packages/net/bsd_tcpip/current/src/ecos/timeout.c ecos_dev/packages/net/bsd_tcpip/current/src/ecos/timeout.c
--- ecos_orig/packages/net/bsd_tcpip/current/src/ecos/timeout.c	2004-04-30 02:13:56.000000000 +0100
+++ ecos_dev/packages/net/bsd_tcpip/current/src/ecos/timeout.c	2006-06-14 14:19:15.531250000 +0100
@@ -62,11 +62,18 @@
 static cyg_handle_t timeout_alarm_handle;
 static cyg_alarm timeout_alarm;
 static cyg_int32 last_delta;
 static cyg_tick_count_t last_set_time;
 
+#if defined(CYGNUM_NET_FAST_THREAD_STACKSIZE) && CYGNUM_NET_FAST_THREAD_STACKSIZE != 0
+// Use CDL set stack size
+#define STACK_SIZE CYGNUM_NET_FAST_THREAD_STACKSIZE
+#else
+// Use default stack size
 #define STACK_SIZE CYGNUM_HAL_STACK_SIZE_TYPICAL
+#endif
+
 static char alarm_stack[STACK_SIZE];
 static cyg_thread alarm_thread_data;
 static cyg_handle_t alarm_thread_handle;
 
 static cyg_flag_t alarm_flag;  
