This refactors event_callback() to separate updating socket event
state from processing the select list (to apply socket event change)
Refactoring changes:
1) select_list_cb processing has been moved to a new local function called
select_check_waiters()
2) goto no_select_wakeup has been removed and now we use a flag
to track whether to call select_check_waiters()
3) There is a small functional change for !LWIP_TCPIP_CORE_LOCKING.
We call SYS_ARCH_UNPROTECT after saving events but before calling
select_check_waiters() (which now calls PROTECT before starting the loop).
Before the code held the PROTECT across saving the events and the first
loop iteration, but this didn't protect against anything because each loop
iteration we do an UNPROTECT/PROTECT
4) Better documentation for both LWIP_TCPIP_CORE_LOCKING and
!LWIP_TCPIP_CORE_LOCKING
These are now defined to return != SYS_ARCH_TIMEOUT on success rather than the time
waiting. The returned times were unused by lwip and this simplifies at
least some implementations.
Signed-off-by: goldsimon <goldsimon@gmx.de>
This is to allow an implementation to use a nesting counter, or a
recursive mutex. Also clarify that the value returned by
sys_arch_protect() is opaque to lwip and implementation dependent.
Signed-off-by: goldsimon <goldsimon@gmx.de>
This fixes a bug where when writing IP_PKTINFO to msg_control, the
msg_controllen field was not updated with the length written
This bug is exposed by applications that provide a msg_control buffer large
enough for multiple control messages. Then when calling CMSG_NXTHDR, it
returned a next cmsg pointer even though was no additional message
The ip6_addr_t structure may have an addition slot so is not necessarily
the size of an ipv6 address, so some uses of sizeof(ip6_addr_t) were not
correct.
Signed-off-by: goldsimon <goldsimon@gmx.de>
No need to have additional if statement for PBUF_REF/PBUF_ROM.
It can be merged to the existing swtich(type) cases.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Adds partial support for selective acknowledgements (RFC 2018).
This change makes lwIP negotiate SACK support, and include SACK
data in outgoing empty ACK packets. It does not include it
in outgoing packets with data payload.
It also does not add support for handling incoming SACKs.
Signed-off-by: goldsimon <goldsimon@gmx.de>