Commit Graph

5711 Commits

Author SHA1 Message Date
Joel Cunningham
b18e6a8734 sockets: fix missing break regression in event_callback
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
2017-10-23 09:05:57 -05:00
Joel Cunningham
22dacc38c0 Revert "Fix two bad "fall-through" code"
This reverts commit a7f2ef4aec.

The fall through is actually a regression
2017-10-23 08:59:43 -05:00
Dirk Ziegelmeier
98d5e06dba Silence gcc 7 warning about fall-through in case statement by adding a comment 2017-10-22 21:27:32 +02:00
Dirk Ziegelmeier
a7f2ef4aec Fix two bad "fall-through" code 2017-10-22 21:26:57 +02:00
Dirk Ziegelmeier
ddcf9cc764 Move all rawapi.txt to appropriate doxygen docs 2017-10-20 21:40:23 +02:00
Dirk Ziegelmeier
33ce04019d Move API description text from rawapi.txt to doxygen docs 2017-10-20 18:44:58 +02:00
Dirk Ziegelmeier
a8edee8268 Move all text from sys_arch.txt to appropriate doxygen places 2017-10-20 18:23:06 +02:00
Joel Cunningham
9c175835d5 sockets: poll Open Group clean ups
1) Define remaining Open Group poll constants (values in hex)
2) Switch nfds_t to unsigned int

http://pubs.opengroup.org/onlinepubs/007908799/xsh/poll.h.html
2017-10-19 14:03:56 -05:00
Nate Karstens
1960937df3 Enable support for MSG_DONTWAIT in lwip_recvmsg()
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>
2017-10-19 13:55:25 -05:00
Dirk Ziegelmeier
f41b5b84b1 Try to fix build of bridgeif_fdb.c 2017-10-19 12:16:11 +02:00
goldsimon
cf07fddf96 lwip_poll_dec_sockets_used: remove unused SYS_ARCH_DECL_PROTECT(lev); 2017-10-19 06:52:33 +02:00
Joel Cunningham
8d04f3d622 docs: correct LWIP_IPV6_MLD reference on #endif comment 2017-10-18 11:48:00 -05:00
Dirk Ziegelmeier
4f2dc05c7c Improve documentation on bridgeif_fdb 2017-10-18 18:31:38 +02:00
Dirk Ziegelmeier
b3a379c239 BridgeIF: Move FDB implementation into a separate file, implementation is easier to understand like this. 2017-10-18 18:27:35 +02:00
Dirk Ziegelmeier
8a46a853d2 Improve system abstraction layer doxygen docs by moving documentation from sys_arch.txt to sys.c 2017-10-17 22:38:18 +02:00
Dirk Ziegelmeier
26b2628f01 Improve system abstraction layer doxygen docs by moving documentation from sys_arch.txt to the corresponding functions 2017-10-17 22:30:51 +02:00
Dirk Ziegelmeier
33f29af0b6 Improve ZeroCopyRx.c code 2017-10-17 22:05:15 +02:00
Dirk Ziegelmeier
84b2a0f55b Remove raw API TCP/UDP function documentation from rawapi.txt - it is now integrated in doxygen docs.
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.
2017-10-17 21:59:34 +02:00
Dirk Ziegelmeier
d020bfc0df Improve UDP documentation using rawapi.txt texts 2017-10-17 21:50:18 +02:00
Dirk Ziegelmeier
558bd73a6d Fix comment indent in main_page.h 2017-10-16 23:27:00 +02:00
Dirk Ziegelmeier
001e1f1127 Improve lwIP doxygen documentation by copying several passages from rawapi.txt to the corresponding doxygen places 2017-10-16 23:24:52 +02:00
Dirk Ziegelmeier
921f601b5d Improve lwIP doxygen documentation by copying several passages from rawapi.txt to the corresponding function documentation 2017-10-16 23:14:28 +02:00
Our Air Quality
4d21d8da23 Allow LWIP_SOCKET_OFFSET with an external FD_SET
Signed-off-by: goldsimon <goldsimon@gmx.de>
2017-10-16 17:07:17 +02:00
Joel Cunningham
0882e0ba89 sockets: poll clean ups
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
2017-10-16 08:06:31 -05:00
Dirk Ziegelmeier
653a1e7778 Fix bug #52113: recv callback: To free or not to free pbuf when returning ERR_ABRT?
Change the text according to Ambroz' suggestion
2017-10-16 10:01:45 +02:00
Dirk Ziegelmeier
ada6a84785 Fix documentation on relocating memory pools 2017-10-15 22:37:41 +02:00
Joel Cunningham
5d8d21fcae Add poll to CHANGELOG 2017-10-13 12:13:55 -05:00
Joel Cunningham
de531131c5 Fix compiler warnings seen with clang 8.1.0 on MacOS
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
2017-10-13 07:52:34 -05:00
Our Air Quality
0794d88f09 If undefined then define O_NDELAY in terms of O_NONBLOCK.
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>
2017-10-09 12:31:23 +02:00
Dirk Ziegelmeier
856b0c3260 Fix bug #52189: list add and remove bug in <lwiperf.c>
Apply patch from xuyao hong
2017-10-09 12:30:12 +02:00
goldsimon
8fc69c9858 Revert changes of 07434aa73a (accidentally committed local changes) 2017-10-06 11:45:10 +02:00
Dirk Ziegelmeier
de5b693e7d Reformat netif subdir using astylerc 2017-10-03 21:22:04 +02:00
Dirk Ziegelmeier
47138f92d0 Fix a few doxygen comment issues 2017-10-02 10:08:48 +02:00
goldsimon
ad4358592a add MEM_SANITY_CHECK (behaves like MEMP_SANITY_CHECK) and ensure 'ram_end->prev' does not get changed 2017-09-26 22:30:18 +02:00
goldsimon
a61aee337b mem.c: beautify converting between struct mem and heap index (add ptr_to_mem/mem_to_ptr) 2017-09-26 22:13:44 +02:00
goldsimon
1710fc1a89 Fix a corner case of double-free in the heap 2017-09-25 22:29:02 +02:00
goldsimon
f058364d7f Added two simple unit tests for illegal calls to mem_free() 2017-09-25 21:38:00 +02:00
goldsimon
5e187bb8bc Tiny typo fix 2017-09-25 20:24:47 +02:00
Jens Nielsen
7115384b15 Clear seg->oversize_left after sending OK
Signed-off-by: goldsimon <goldsimon@gmx.de>
2017-09-25 20:21:17 +02:00
Joel Cunningham
6cdfae1245 sockets: cleanup ioctlsocket for LWIP_COMPAT_SOCKETS == 2 (patch #9456)
This makes two cleanups that follows the same organization as close/closesocket:

 1) There is no lwip_ioctlsocket. Instead lwip_ioctl should redirect to ioctlsocket
 2) With LWIP_POSIX_SOCKETS_IO_NAMES enabled, lwip_ioctl/ioctlsocket should redirect to ioctl
2017-09-22 08:51:48 -05:00
goldsimon
0c2d94a283 sntp: allow SNTP_UPDATE_DELAY to be a function 2017-09-22 06:26:53 +02:00
goldsimon
68d75a58df sockets: adapt poll to LWIP_MPU_COMPATIBLE; make LWIP_SOCKET_POLL and LWIP_SOCKET_SELECT independent options 2017-09-21 22:18:55 +02:00
Kalle Olavi Niemitalo
1152fd02c0 New sockets function: lwip_poll
Signed-off-by: goldsimon <goldsimon@gmx.de>
2017-09-21 21:50:36 +02:00
goldsimon
333f1bf2bd Fix compiling with LWIP_SOCKET_SELECT==0 2017-09-21 21:49:31 +02:00
Kalle Olavi Niemitalo
983eb8ebb4 Move select_cb list handling to functions (prepare for adding "poll")
Signed-off-by: goldsimon <goldsimon@gmx.de>
2017-09-21 21:10:08 +02:00
goldsimon
61e0a42cce Guard LWIP_COMPAT_SOCKETS definitions of lwip_socket with LWIP_SOCKET_SELECT 2017-09-21 21:05:50 +02:00
goldsimon
60356514c7 Guard struct lwip_select_cb definition with LWIP_SOCKET_SELECT 2017-09-21 20:20:23 +02:00
Our Air Quality
dbd726959c [PATCH] Replace the OOSEQ max bytes and pbufs constants with functions.
Some systems need to take into account an RX buffer pool size when
advising an appropriate number of RX pbufs to queue on the ooseq
list. For some systems there is a practical hard limit beyond which
the rx pool becomes exhausted blocking reception of further buffers
until some are freed.

It also helps to be able to consider the available dynamic memory when
advising an appropriate maximum number of bytes to buffer on the ooseq
list.

These decisions can also benefit from knowing the number already
allocated on a particular pcb, so the ooseq tcp segement is passed to
these functions. For example, if the system only wants to allow the
total number of rx pbufs queued on all the ooseq lists to grow by one
and a pcb already has two then it can return three for this call, but
might return one for another call - supporting a greedy allocation
strategy.

Signed-off-by: goldsimon <goldsimon@gmx.de>
2017-09-21 10:36:21 +02:00
goldsimon
7dcc407c53 tcp_in: favour local variables over ifdef blocks 2017-09-21 10:12:36 +02:00
goldsimon
8f459cc242 Make TCP_OOSEQ_MAX_BYTES and TCP_OOSEQ_MAX_PBUFS work independently 2017-09-21 09:52:51 +02:00