From 3f2227f04c6361a7eb091a772e1b4fdbdee343db Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Wed, 13 Jun 2018 09:38:04 +0200 Subject: [PATCH] Fix pppos after changing PBUF_POOL to PBUF_RAM This partly reverts 31bc2f9b which broke pppos tx as 'pppos_output_append' implements a custom scheme of checking available pbuf size. Added a comment why PBUF_POOL is ok for tx in this special case. See bug #51908 Signed-off-by: Simon Goldschmidt --- src/netif/ppp/pppos.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/netif/ppp/pppos.c b/src/netif/ppp/pppos.c index 978ddab4..246bead8 100644 --- a/src/netif/ppp/pppos.c +++ b/src/netif/ppp/pppos.c @@ -207,8 +207,10 @@ pppos_write(ppp_pcb *ppp, void *ctx, struct pbuf *p) err_t err; LWIP_UNUSED_ARG(ppp); - /* Grab an output buffer. */ - nb = pbuf_alloc(PBUF_RAW, 0, PBUF_RAM); + /* Grab an output buffer. Using PBUF_POOL here for tx is ok since the pbuf + gets freed by 'pppos_output_last' before this function returns and thus + cannot starve rx. */ + nb = pbuf_alloc(PBUF_RAW, 0, PBUF_POOL); if (nb == NULL) { PPPDEBUG(LOG_WARNING, ("pppos_write[%d]: alloc fail\n", ppp->netif->num)); LINK_STATS_INC(link.memerr); @@ -256,8 +258,10 @@ pppos_netif_output(ppp_pcb *ppp, void *ctx, struct pbuf *pb, u16_t protocol) err_t err; LWIP_UNUSED_ARG(ppp); - /* Grab an output buffer. */ - nb = pbuf_alloc(PBUF_RAW, 0, PBUF_RAM); + /* Grab an output buffer. Using PBUF_POOL here for tx is ok since the pbuf + gets freed by 'pppos_output_last' before this function returns and thus + cannot starve rx. */ + nb = pbuf_alloc(PBUF_RAW, 0, PBUF_POOL); if (nb == NULL) { PPPDEBUG(LOG_WARNING, ("pppos_netif_output[%d]: alloc fail\n", ppp->netif->num)); LINK_STATS_INC(link.memerr);