diff --git a/ChangeLog b/ChangeLog index 6543fbad9162e5cc2b316a98421b5b6f25cd2fa7..cab2ef20360af178d28fc0cd7bc70d83fd4a7c5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -233,4 +233,5 @@ * Add strcat() and strncat() * Integrated uIP micro webserver * Corrected a serious bug in TCP queue management + * Fix leak in socket close logic diff --git a/Documentation/NuttX.html b/Documentation/NuttX.html index 2bee653cd0fb71dd3a5fd195dead43db84a2f7be..870918360ed241844ece86cc2b6cfca7d46a69ae 100644 --- a/Documentation/NuttX.html +++ b/Documentation/NuttX.html @@ -358,14 +358,24 @@ is available that be used to build a NuttX-compatible arm-elf toolchain.</blockq 53272 428 3568 57268 dfb4 nuttx </pre> <p><b>DM320 (ARM9)</b> - This build for the ARM9 target includes a signficant subset of OS - features, ethernet driver and full TCP/IP, UDP and (minimal) ICMP - stacks (via uIP). (11/8/07) + This build for the ARM9 target includes a significant subset of OS + features, a filesystem, Ethernet driver, full TCP/IP, UDP and (minimal) + ICMP stacks (via uIP) and a small network test application: (11/8/07, + configuration netconfig, examples/nettest) </p> <pre> text data bss dec hex filename 49472 296 3972 53740 d1ec nuttx </pre> +<p> + Another build for the ARM9 target includes a minimal OS feature + set, Ethernet driver, full TCP/IP and (minimal) ICMP stacks, and + a small webserver: (11/20/07, configuration uipconfig, examples/uip) +</p> +<pre> + text data bss dec hex filename + 52040 72 4148 56260 dbc4 nuttx +</pre> <p><b>87C52</b> A reduced functionality OS test for the 8052 target requires only about 18-19Kb: @@ -694,6 +704,7 @@ Other memory: * Add strcat() and strncat() * Integrated uIP micro webserver * Corrected a serious bug in TCP queue management + * Fix leak in socket close logic </pre></ul> <table width ="100%"> diff --git a/TODO b/TODO index 48f4896722e53f36baacc329f57b8174576e9759..0b8220e004fb481373ded7560b8e4903ad2ee568 100644 --- a/TODO +++ b/TODO @@ -31,8 +31,9 @@ o C++ Support o Network - Did not implement send() and sendto() timeouts. Option is setable via setsockopt, but is not implemented. -- netutils/telnetd (and maybe others) are seriously broken. +- uIP's netutils/telnetd (and maybe others) are seriously broken. Need to be re-written to use listen() and accept() +- uIP's netutils/webserver does not work reliably - Should implement SOCK_RAW - accept() and recvfrom() need to return connection address - Performance Improvements (uIP is not very fast): diff --git a/net/net-close.c b/net/net-close.c index ca28b510bda4543fe9e6f9ec41ec9f6c88db4b02..c06e635d1cb4ee8b07de4b509890851b6233ab36 100644 --- a/net/net-close.c +++ b/net/net-close.c @@ -79,12 +79,16 @@ int net_close(int sockfd) goto errout; } - /* Perform the close depending on the protocol type */ + /* Perform uIP side of the close depending on the protocol type */ switch (psock->s_type) { case SOCK_STREAM: - uip_tcpfree(psock->s_conn); + { + struct uip_conn *conn = psock->s_conn; + uip_unlisten(conn); + uip_tcpfree(conn); + } break; #ifdef CONFIG_NET_UDP @@ -97,11 +101,9 @@ int net_close(int sockfd) goto errout; } - /* Save the protocol type */ - - psock->s_type = 0; - psock->s_conn = NULL; + /* Then release the socket structure containing the connection */ + sockfd_release(sockfd); return OK; errout: diff --git a/net/net-sockets.c b/net/net-sockets.c index 98f9413bdb583b9956b9754f2e612407857af5f9..8be75def2aba5a5d8a7d024b274a8e02f7118547 100644 --- a/net/net-sockets.c +++ b/net/net-sockets.c @@ -45,6 +45,7 @@ #include <assert.h> #include <sched.h> #include <errno.h> +#include <debug.h> #include <net/uip/uip.h> #include <nuttx/net.h>