mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-05 22:29:49 +00:00
LWIP_LOOPBACK_MAX_PBUFS: fix compilation or memory leak for LWIP_LOOPBACK_MAX_PBUFS > 255
This commit is contained in:
parent
af0f4d4020
commit
197166d906
@ -956,7 +956,7 @@ netif_loop_output(struct netif *netif, struct pbuf *p)
|
|||||||
clen = pbuf_clen(r);
|
clen = pbuf_clen(r);
|
||||||
/* check for overflow or too many pbuf on queue */
|
/* check for overflow or too many pbuf on queue */
|
||||||
if (((netif->loop_cnt_current + clen) < netif->loop_cnt_current) ||
|
if (((netif->loop_cnt_current + clen) < netif->loop_cnt_current) ||
|
||||||
((netif->loop_cnt_current + clen) > LWIP_LOOPBACK_MAX_PBUFS)) {
|
((netif->loop_cnt_current + clen) > LWIP_MAX(LWIP_LOOPBACK_MAX_PBUFS, 0xFFFF))) {
|
||||||
pbuf_free(r);
|
pbuf_free(r);
|
||||||
LINK_STATS_INC(link.memerr);
|
LINK_STATS_INC(link.memerr);
|
||||||
LINK_STATS_INC(link.drop);
|
LINK_STATS_INC(link.drop);
|
||||||
|
Loading…
Reference in New Issue
Block a user