diff --git a/libraries/net/eth/lwip-eth/arch/lpc17_emac.c b/libraries/net/eth/lwip-eth/arch/lpc17_emac.c index 243f9930a04..e082fd495fa 100644 --- a/libraries/net/eth/lwip-eth/arch/lpc17_emac.c +++ b/libraries/net/eth/lwip-eth/arch/lpc17_emac.c @@ -346,6 +346,7 @@ static struct pbuf *lpc_low_level_input(struct netif *netif) struct lpc_enetdata *lpc_enetif = netif->state; struct pbuf *p = NULL; u32_t idx, length; + u16_t origLength; #ifdef LOCK_RX_THREAD #if NO_SYS == 0 @@ -428,6 +429,7 @@ static struct pbuf *lpc_low_level_input(struct netif *netif) /* Zero-copy */ p = lpc_enetif->rxb[idx]; + origLength = p->len; p->len = (u16_t) length; /* Free pbuf from descriptor */ @@ -440,6 +442,7 @@ static struct pbuf *lpc_low_level_input(struct netif *netif) LINK_STATS_INC(link.drop); /* Re-queue the pbuf for receive */ + p->len = origLength; lpc_rxqueue_pbuf(lpc_enetif, p); LWIP_DEBUGF(UDP_LPC_EMAC | LWIP_DBG_TRACE, @@ -809,9 +812,8 @@ static void packet_rx(void* pvParameters) { /* Wait for receive task to wakeup */ sys_arch_sem_wait(&lpc_enetif->RxSem, 0); - /* Process packets until all empty */ - while (LPC_EMAC->RxConsumeIndex != LPC_EMAC->RxProduceIndex) - lpc_enetif_input(lpc_enetif->netif); + /* Process packet for this semaphore signal */ + lpc_enetif_input(lpc_enetif->netif); } } diff --git a/libraries/net/lwip/lwip/core/pbuf.c b/libraries/net/lwip/lwip/core/pbuf.c index 818eb620356..cd37c797237 100644 --- a/libraries/net/lwip/lwip/core/pbuf.c +++ b/libraries/net/lwip/lwip/core/pbuf.c @@ -998,6 +998,8 @@ pbuf_coalesce(struct pbuf *p, pbuf_layer layer) } err = pbuf_copy(q, p); LWIP_ASSERT("pbuf_copy failed", err == ERR_OK); + /* next line references err variable even if LWIP_ASSERT is ignored. */ + (void)err; pbuf_free(p); return q; } diff --git a/libraries/net/lwip/lwip/lwipopts.h b/libraries/net/lwip/lwip/lwipopts.h index 10846e24169..4d07680dbcf 100644 --- a/libraries/net/lwip/lwip/lwipopts.h +++ b/libraries/net/lwip/lwip/lwipopts.h @@ -27,6 +27,8 @@ #if NO_SYS == 0 #include "cmsis_os.h" +#define SYS_LIGHTWEIGHT_PROT 1 + #define LWIP_RAW 0 #define TCPIP_MBOX_SIZE 8 @@ -99,6 +101,7 @@ #define MEMP_OVERFLOW_CHECK 1 #define MEMP_SANITY_CHECK 1 #else +#define LWIP_NOASSERT 1 #define LWIP_STATS 0 #endif