RCS file: /cvsroot/lwip/lwip/src/netif/loopif.c,v retrieving revision 1.8 diff -u -w -b -r1.8 loopif.c --- loopif.c 9 Jun 2003 21:14:47 -0000 1.8 +++ loopif.c 30 Jul 2003 12:03:10 -0000 @@ -41,12 +41,23 @@ #include "lwip/ip.h" /*-----------------------------------------------------------------------------------*/ +static void +loopif_input( void * arg ) +{ + struct netif *netif = (struct netif *)( ((void **)arg)[ 0 ] ); + struct pbuf *r = (struct pbuf *)( ((void **)arg)[ 1 ] ); + + mem_free( arg ); + netif -> input( r, netif ); +} +/*-----------------------------------------------------------------------------------*/ static err_t loopif_output(struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr) { struct pbuf *q, *r; char *ptr; + void **arg; #if defined(LWIP_DEBUG) && defined(LWIP_TCPDUMP) tcpdump(p); @@ -60,7 +71,16 @@ memcpy(ptr, q->payload, q->len); ptr += q->len; } - netif->input(r, netif); + + arg = mem_malloc( sizeof( void *[ 2 ] ) ); + if( NULL == arg ) { + return ERR_MEM; + } + + arg[ 0 ] = netif; + arg[ 1 ] = r; + sys_timeout( 1, loopif_input, arg ); + return ERR_OK; } return ERR_MEM;