Mercurial > nand-ecoscentric
changeset 2101:b3747ba64a2d
* src/core/tcp_in.c: pbuf_free() assert triggered by
NULLified inseg.p
* include/lwip/tcp.h Do no longer try to free pbuf
when TCP_EVENT_RECV() is called without a callback
handler, and without packet.
* tests/nc_test_slave.c Fixed test_printf and diag_printf
format strings that caused errors or warnings.
* tests/nc_test_slave.c Included <lwip/inet.h> - required
for compilation
* src/ecos/init.c Added structs ip_addr ipaddr, netmask and gw
in lwip_init() if loop interface is used
| author | asl |
|---|---|
| date | Mon, 07 Nov 2005 16:33:15 +0000 |
| parents | b98f84205fdc |
| children | ede282e6434e |
| files | packages/net/lwip_tcpip/current/ChangeLog packages/net/lwip_tcpip/current/include/lwip/tcp.h packages/net/lwip_tcpip/current/src/core/tcp_in.c packages/net/lwip_tcpip/current/src/ecos/init.c packages/net/lwip_tcpip/current/tests/nc_test_slave.c packages/net/lwip_tcpip/current/tests/socket.c |
| diffstat | 6 files changed, 34 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/packages/net/lwip_tcpip/current/ChangeLog +++ b/packages/net/lwip_tcpip/current/ChangeLog @@ -1,3 +1,17 @@ +2005-10-07 Uwe Kindler <uwe_kindler@web.de> + + * src/core/tcp_in.c: pbuf_free() assert triggered by + NULLified inseg.p + * include/lwip/tcp.h Do no longer try to free pbuf + when TCP_EVENT_RECV() is called without a callback + handler, and without packet. + * tests/nc_test_slave.c Fixed test_printf and diag_printf + format strings that caused errors or warnings. + * tests/nc_test_slave.c Included <lwip/inet.h> - required + for compilation + * src/ecos/init.c Added structs ip_addr ipaddr, netmask and gw + in lwip_init() if loop interface is used + 2004-05-05 Jani Monoses <jani@iv.ro> * src/netif/ppp/ppp.c: Decrease sleep period in main thread
--- a/packages/net/lwip_tcpip/current/include/lwip/tcp.h +++ b/packages/net/lwip_tcpip/current/include/lwip/tcp.h @@ -375,7 +375,7 @@ err_t lwip_tcp_event(void *arg, struct t #define TCP_EVENT_RECV(pcb,p,err,ret) \ if((pcb)->recv != NULL) \ { ret = (pcb)->recv((pcb)->callback_arg,(pcb),(p),(err)); } else { \ - pbuf_free(p); } + if (p) pbuf_free(p); } #define TCP_EVENT_CONNECTED(pcb,err,ret) \ if((pcb)->connected != NULL) \ (ret = (pcb)->connected((pcb)->callback_arg,(pcb),(err)))
--- a/packages/net/lwip_tcpip/current/src/core/tcp_in.c +++ b/packages/net/lwip_tcpip/current/src/core/tcp_in.c @@ -351,7 +351,7 @@ tcp_input(struct pbuf *p, struct netif * increase the reference counter in the pbuf. If so, the buffer isn't actually deallocated by the call to pbuf_free(), only the reference count is decreased. */ - pbuf_free(inseg.p); + if (inseg.p != NULL) pbuf_free(inseg.p); #if TCP_INPUT_DEBUG #if TCP_DEBUG tcp_debug_print_state(pcb->state);
--- a/packages/net/lwip_tcpip/current/src/ecos/init.c +++ b/packages/net/lwip_tcpip/current/src/ecos/init.c @@ -123,7 +123,9 @@ struct netif ecos_loopif; int lwip_init(void) { +#if LWIP_HAVE_LOOPIF struct ip_addr ipaddr, netmask, gw; +#endif static int inited = 0; sys_sem_t sem; if (inited)
--- a/packages/net/lwip_tcpip/current/tests/nc_test_slave.c +++ b/packages/net/lwip_tcpip/current/tests/nc_test_slave.c @@ -42,6 +42,7 @@ #include <lwip/inet.h> #include <lwip/arch.h> +#include <lwip/sys.h> #define LWIP_TIMEVAL_PRIVATE #include <lwip/sockets.h> @@ -58,9 +59,14 @@ #define MAIN_THREAD_PRIORITY CYGPKG_NET_THREAD_PRIORITY-2 #define DESIRED_BACKGROUND_LOAD 20 #define CYGHWR_NET_DRIVERS 1 + +#if 0 static char main_thread_stack[CYGHWR_NET_DRIVERS][STACK_SIZE]; static cyg_thread main_thread_data[CYGHWR_NET_DRIVERS]; static cyg_handle_t main_thread_handle[CYGHWR_NET_DRIVERS]; +#endif + + static char idle_thread_stack[STACK_SIZE]; static cyg_thread idle_thread_data; static cyg_handle_t idle_thread_handle; @@ -185,7 +191,7 @@ do_udp_test(int s1, struct nc_request *r seq_errors++; } } else { - test_printf("Bad data packet - key: %x/%x, seq: %d\n", + test_printf("Bad data packet - key: %lx/%lx, seq: %d\n", ntohl(tdp->key1), ntohl(tdp->key2), ntohl(tdp->seq)); } @@ -358,7 +364,7 @@ do_tcp_test(int s1, struct nc_request *r seq_errors++; } } else { - test_printf("Bad data packet - key: %x/%x, seq: %d\n", + test_printf("Bad data packet - key: %lx/%lx, seq: %d\n", ntohl(tdp->key1), ntohl(tdp->key2), ntohl(tdp->seq)); } @@ -514,8 +520,9 @@ nc_slave(test_param_t param) } void -net_test(test_param_t param) +net_test(void *arg) { + test_param_t param = (test_param_t)arg; // int i; if (param == 0) { test_printf("Start Network Characterization - SLAVE\n"); @@ -571,7 +578,7 @@ calibrate_load(int desired_load) load_idle = idle_thread_count; start_load(0); // Shut down background load percent_load = 100 - ((load_idle * 100) / no_load_idle); - diag_printf("High Load[%d] = %d => %d%%\n", load_thread_level, + diag_printf("High Load[%ld] = %d => %d%%\n", load_thread_level, (int)idle_thread_count, percent_load); if ( percent_load > desired_load ) break; // HIGH level is indeed higher @@ -590,7 +597,7 @@ calibrate_load(int desired_load) load_idle = idle_thread_count; start_load(0); // Shut down background load percent_load = 100 - ((load_idle * 100) / no_load_idle); - diag_printf("Load[%d] = %d => %d%%\n", load_thread_level, + diag_printf("Load[%ld] = %d => %d%%\n", load_thread_level, (int)idle_thread_count, percent_load); if (((high-low) <= 1) || (abs(desired_load-percent_load) <= 2)) break; if (percent_load < desired_load) { @@ -612,7 +619,7 @@ calibrate_load(int desired_load) load_idle = idle_thread_count; start_load(0); // Shut down background load percent_load = 100 - ((load_idle * 100) / no_load_idle); - diag_printf("Final load[%d] = %d => %d%%\n", load_thread_level, + diag_printf("Final load[%ld] = %d => %d%%\n", load_thread_level, (int)idle_thread_count, percent_load); // no_load_idle_count_1_second = no_load_idle; }
--- a/packages/net/lwip_tcpip/current/tests/socket.c +++ b/packages/net/lwip_tcpip/current/tests/socket.c @@ -32,9 +32,10 @@ /* Simple test-case for the BSD socket API : echo on TCP port 7 */ -#include "lwip/sys.h" +#include <lwip/sys.h> #define LWIP_COMPAT_SOCKETS 1 -#include "lwip/sockets.h" +#include <lwip/sockets.h> +#include <lwip/inet.h> char buf[400]; static void
