I got below build warning if LWIP_HOOK_MEMP_AVAILABLE is defined.
src/core/memp.c: In function 'memp_free_pool':
src/core/memp.c:352:16: warning: variable 'old_first' set but not used [-Wunused-but-set-variable]
struct memp *old_first;
^
src/core/memp.c: In function 'memp_free':
src/core/memp.c:413:6: warning: 'old_first' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (old_first == NULL) {
The LWIP_HOOK_MEMP_AVAILABLE() hook does not work, fix it.
Fixes: c838e1ed5b ("Implement possibility to declare private memory pools")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
LWIP_NETCONN and LWIP_SOCKET are defined in opt.h,
so move #include "lwip/opt.h" out of #if LWIP_NETCONN || LWIP_SOCKET guard.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
pbuf_alloc() for PBUF_RAM type always return big enough memory on success.
So checking p->len is not necessary. Testing if p is NULL or not is enough.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Current code already checks memp_overflow_check_all() in memp_free() if
MEMP_OVERFLOW_CHECK >= 2. So in memp_free_pool(), it should use
MEMP_OVERFLOW_CHECK == 1 instead.
Fixes: c838e1ed5b ("Implement possibility to declare private memory pools")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
The h will point to NULL if h->next->next is NULL anyway.
So remove the unnecessary NULL test for h->next->next in each iteration.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
There should be no duplicate pcb in raw_pcbs/udp_pcbs list.
So the implementation of raw_remove()/udp_remove() can break from the for
loop once the target pcb is found and removed from the list.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
The TCPIP_APIMSG_ACK will call NETCONN_SET_SAFE_ERR for both
LWIP_TCPIP_CORE_LOCKING and !LWIP_TCPIP_CORE_LOCKING cases.
So remove superfluous NETCONN_SET_SAFE_ERR call before TCPIP_APIMSG_ACK.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
The logic to use an already existing pcb is wrong because the idx never
advanced in the for loop, so it keep checking the same dns_pcbs[idx] for
each loop iteration. Fix it.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit updates the snd_queuelen comment documentation to reflect
that snd_queuelen tracks the number of pbufs currently in the send
buffer (unsent + unacked queues) rather than the number of pbufs
available in the buffer (which was what previous comment implied)
This commit updates socket option comments to reflect which ones are
currently supported:
* SO_REUSEPORT is no longer implemented
* SO_SNDTIMEO is implemented