REM:
1. 修正pbuf内存多次释放异常问题
This commit is contained in:
huangxin 2022-05-30 20:16:06 +08:00
parent 0e36a331e4
commit 92b9277abc
2 changed files with 8 additions and 4 deletions

View File

@ -177,7 +177,7 @@
/**
* PBUF_POOL_SIZE: the number of buffers in the pbuf pool.
*/
#define PBUF_POOL_SIZE 10000
#define PBUF_POOL_SIZE 8
/*
---------------------------------
@ -477,7 +477,7 @@ void sys_unlock_tcpip_core(void);
#define LWIP_DBG_TYPES_ON (LWIP_DBG_ON|LWIP_DBG_TRACE|LWIP_DBG_STATE|LWIP_DBG_FRESH)
//#define ETHARP_DEBUG LWIP_DBG_ON
#define NETIF_DEBUG LWIP_DBG_ON
//#define NETIF_DEBUG LWIP_DBG_ON
//#define PBUF_DEBUG LWIP_DBG_ON
//#define API_LIB_DEBUG LWIP_DBG_ON
//#define API_MSG_DEBUG LWIP_DBG_ON
@ -502,7 +502,7 @@ void sys_unlock_tcpip_core(void);
//#define TCP_QLEN_DEBUG LWIP_DBG_ON
//#define UDP_DEBUG LWIP_DBG_ON
//#define TCPIP_DEBUG LWIP_DBG_ON
#define PPP_DEBUG LWIP_DBG_ON
//#define PPP_DEBUG LWIP_DBG_ON
//#define SLIP_DEBUG LWIP_DBG_ON
//#define DHCP_DEBUG LWIP_DBG_ON
//#define AUTOIP_DEBUG LWIP_DBG_ON

View File

@ -750,7 +750,11 @@ pbuf_free(struct pbuf *p)
* further protection. */
SYS_ARCH_PROTECT(old_level);
/* all pbufs in a chain are referenced at least once */
LWIP_ASSERT("pbuf_free: p->ref > 0", p->ref > 0);
//LWIP_ASSERT("pbuf_free: p->ref > 0", p->ref > 0);
if(p->ref == 0) {
return 1;
}
/* decrease reference count (number of pointers to pbuf) */
ref = --(p->ref);
SYS_ARCH_UNPROTECT(old_level);