It does not make sense to return success in p == NULL or
invalid header_size_increment/header_size_decrement cases. Fix it.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
The macros are functions from ctype.h, but ctype.h declares them as functions, not as #defines
It makes no sense to abstract them in lwIPs portability layer, the functions are of low complexity and they are only used in this file.
ARMCC when using __packed structures will not implicitly convert a
pointer to a member of a packed structure to something which does not
have __packed. This results in a compiler error and was found with calls
to icmp6_param_problem
While there is a #pragma pack mode in ARMCC that disables this error, it
does require existing ports to switch over their packing mode and
perform integration
During the refactoring in c5db278746, the
previous gotos were removed, but the lack of break statements in
NETCONN_EVNT_RCVMINUS and NETCONN_EVT_SENDMINUS was overlooked, leading
to incorrect fall through behavior
Enables support for MSG_DONTWAIT in lwip_recvmsg(). Support already
exists in lwip_recv_tcp() and lwip_recvfrom_udp_raw(); these are both
accessible from lwip_recvfrom(), which already supports MSG_DONTWAIT.
Signed-off-by: Nate Karstens <nate.karstens@garmin.com>
Signed-off-by: Joel Cunningham <joel.cunningham@me.com>
This avoid having a second description for the same stuff that is "bit-rotting" because noone remembers to update this file.
Also remove outdated and misleading zero-copy TX information.
This makes the following poll cleanups:
1) Add LWIP_ERROR in lwip_poll to check for invalid fds/nfds combinations.
This fixes a possible a NULL fds dereference in lwip_poll_scan()
2) Use has_ copies of the socket events in lwip_poll_should_wake() rather
passing the sock pointer and accessing socket after leaving the critical
section
This fixes the following warnings:
test_tcp.c:266:5: error: code will never be executed [-Werror,-Wunreachable-code]
pbuf_free(p);
^~~~~~~~~
- The check API 'fail' aborts the test, thus pbuf_free(p) will never be executed
pbuf.c:783:111: error: format specifies type 'unsigned short' but the argument has type 'u8_t' (aka 'unsigned char') [-Werror,-Wformat]
LWIP_DEBUGF( PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_free: %p has ref %"U16_F", ending here.\n", (void *)p, ref));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
- LWIP_PBUF_REF_T is u8_t by default and doesn't match U16_F, so cast to u16_t. The cast and formatter will need to be changed
if ref is larger than 16 bits
ethernet.c:105:16: error: format specifies type 'unsigned char' but the argument has type 'unsigned int' [-Werror,-Wformat]
(unsigned)ethhdr->dest.addr[0], (unsigned)ethhdr->dest.addr[1], (unsigned)ethhdr->dest.addr[2],
~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- addr[] is type u8_t, formatter is X8_F which should be 8 bits. 'unsigned' is an int, so cast to unsighed char instead
Current newlib does not define O_NDELAY, but it needs to be the same
as O_NONBLOCK rather than using the lwip value of 1.
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net>