[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] about ip_forward problem :could not allocate room for heade
From: |
WU Rui-qing |
Subject: |
[lwip-users] about ip_forward problem :could not allocate room for header |
Date: |
Fri, 18 Jul 2008 20:3:50 +0800 |
Hello all,
I have some trouble in ip_forward .I want that lwip1.3.0 runs as a router
which forwards IP packet from PPP to ethernet. But it return with error in :
err_t
etharp_output(struct netif *netif, struct pbuf *q, struct ip_addr *ipaddr)
{
struct eth_addr *dest, mcastaddr;
/* make room for Ethernet header - should not fail */
if (pbuf_header(q, sizeof(struct eth_hdr)) != 0) {
/* bail out */
LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE | 2, ("etharp_output: could not
allocate room for header.\n"));
LINK_STATS_INC(link.lenerr);
return ERR_BUF;
}
...
}
In the pubf_header function,error occurs at line :LWIP_DEBUGF( PBUF_DEBUG | 2,
("pbuf_header: failed as p < p (not enough space for new header size)\n",
LwIP can not re-aggregate packt header in packet from PPP,and forward it by
ethernet interface ?
I hope some guidance on this problem can be provided. Thanks a lot !
======= 2008-07-17 14:34:00 您在来信中写道:=======
>Hi All,
>
>I meet the out of memory problem
>
>##################################################
>Assertion "mem_malloc2(): return NULL!" failed at line 555 in
>....\lwip_related\lwip\src\core\mem.c
>251277:assert_mine.c,14,ASSERT,FN=...\lwip_related\lwip\src\core\mem.c,LN=555,VL=0
>###################################################
>
>I think the out of memory is caused the memory fragment. In my unit
>test, it won't meet any problem, just happened in true environement.
>
>
>I tried to enable MEM_USE_POOLS macro, but meet the compiler error.
>There related code is too skillful. I unable to find the problem now.
>
>################################
>#ifndef MEM_USE_POOLS
>#define MEM_USE_POOLS 1
>#endif
>##################################
>
>########################## memp.h##################
>#if MEM_USE_POOLS
>/* Use a helper type to get the start and end of the user "memory
>pools" for mem_malloc */
>typedef enum {
> /* Get the first (via:
> MEMP_POOL_HELPER_START = ((u8_t) 1*MEMP_POOL_A + 0*MEMP_POOL_B
>+ 0*MEMP_POOL_C + 0)*/
> MEMP_POOL_HELPER_FIRST = ((u8_t)
>#define LWIP_MEMPOOL(name,num,size,desc)
>#define LWIP_MALLOC_MEMPOOL_START 1
>#define LWIP_MALLOC_MEMPOOL(num, size) * MEMP_POOL_##size + 0
>#define LWIP_MALLOC_MEMPOOL_END
>#include "lwip/memp_std.h"
> ) , <<<======compiler report here is the
> problem
> /* Get the last (via:
> MEMP_POOL_HELPER_END = ((u8_t) 0 + MEMP_POOL_A*0 +
>MEMP_POOL_B*0 + MEMP_POOL_C*1) */
> MEMP_POOL_HELPER_LAST = ((u8_t)
>#define LWIP_MEMPOOL(name,num,size,desc)
>#define LWIP_MALLOC_MEMPOOL_START
>#define LWIP_MALLOC_MEMPOOL(num, size) 0 + MEMP_POOL_##size *
>#define LWIP_MALLOC_MEMPOOL_END 1
>#include "lwip/memp_std.h"
> )
>} memp_pool_helper_t;
>####################################################
>
>Is there any one using MEM_USE_POOLS configuration? Is the default
>feature working?
>
>or where should I make change.
>
>Lee
>
>
>_______________________________________________
>lwip-users mailing list
>address@hidden
>http://lists.nongnu.org/mailman/listinfo/lwip-users
= = = = = = = = = = = = = = = = = = = =
致
礼!
WU Rui-qing
address@hidden
2008-07-18
- [lwip-users] about ip_forward problem :could not allocate room for header,
WU Rui-qing <=