Commit Graph

638 Commits

Author SHA1 Message Date
Dirk Ziegelmeier
d6adc1f6cb Rename tcpip_send_api_msg to tcpip_send_msg_wait_sem (hopefully a little bit clearer name) 2016-03-16 21:57:24 +01:00
Dirk Ziegelmeier
d38cdccbcd netconn API: Remove api_msg wrapper struct, it is not needed any more 2016-03-16 21:35:21 +01:00
Dirk Ziegelmeier
2575c7fb5f netconn API: Cleanup, remove lots of #defines, take advantage of new tcpip_send_api_msg function feature to abstract core locking away 2016-03-16 21:35:21 +01:00
Dirk Ziegelmeier
ea174560b1 tcpip.c tcpip_send_api_msg: Handle core locking case internally 2016-03-16 21:35:21 +01:00
Dirk Ziegelmeier
bc51dddcaf Add some comments to functions and #defines. According to Simon, LWIP core locking is not experimental any more. 2016-03-16 21:35:21 +01:00
Dirk Ziegelmeier
0d576aa521 Fix bug #47426 incorrect typecast in pppapi.c 2016-03-16 12:37:08 +01:00
Dirk Ziegelmeier
1d7996dc47 tcpip API calls: Implement LWIP_NETCONN_SEM_PER_THREAD support for ALL API calls 2016-03-13 19:43:49 +01:00
Dirk Ziegelmeier
00975769a0 Minor TCPIP API call functions cleanup 2016-03-10 22:44:31 +01:00
Dirk Ziegelmeier
f7a3d6cca5 Port PPP API to new simple tcpip API call method 2016-03-10 22:44:25 +01:00
Dirk Ziegelmeier
8f71795844 Port netifapi to new simple tcpip API call method 2016-03-10 22:42:21 +01:00
Dirk Ziegelmeier
8106413644 tcpip.c: Implement an easier way for TCPIP API calls - client code does not have to deal with semaphores and core locking any more 2016-03-10 22:42:21 +01:00
sg
5e472badf1 Work on bug #44595: remove check for recvmbox != NULL from netconn_recv() to let it return ERR_CLSD for half-closed TCP connections 2016-03-10 21:20:25 +01:00
Dirk Ziegelmeier
ba40925335 tcpip_send_api_msg function is only needed in non-core-locking mode 2016-03-08 19:41:32 +01:00
Dirk Ziegelmeier
eab92ccb03 netifapi: Eliminate wrapper struct netifapi_msg and rename netifapi_msg_msg to netifapi_msg 2016-03-08 19:41:32 +01:00
Dirk Ziegelmeier
fc17d02451 Fix compile with LWIP_TCPIP_CORE_LOCKING 2016-03-08 19:41:32 +01:00
Dirk Ziegelmeier
37d514c949 Minor cleanups in #includes and comments 2016-03-08 19:41:32 +01:00
Dirk Ziegelmeier
c65eca58c9 Decouple tcpip.c/tcpip_priv.h from netconn API 2016-03-08 19:41:32 +01:00
Dirk Ziegelmeier
18bb74e5c5 Decouple tcpip.c/tcpip_priv.h from PPP API
PPP API can now be moved to netif/ppp subdir
2016-03-08 19:41:32 +01:00
Dirk Ziegelmeier
af1978fa4e Implement generic API message handling
Add generic tcpip_send_api_msg function
Let netif API and netconn API use it
Decouple tcpip.c and tcpip_priv.h from netif API
2016-03-08 19:41:32 +01:00
Joel Cunningham
80cc988f2f Optimize sendmsg UDP pbuf chain creation
This commit optimizes the sendmsg UDP pbuf chain creation by not
allocating/freeing a netbuf per io vector and instead building a pbuf
chain directly in the sockets layer
2016-03-07 09:26:58 -06:00
sg
076795562e fixed typo in one of the last commits 2016-03-06 20:59:50 +01:00
sg
375ec36246 ERR_IF is not necessarily a fatal error (fixes bug #46338: UDP netconns block after fatal error) 2016-03-05 16:15:04 +01:00
Dirk Ziegelmeier
bcab7fef84 netifapi.c: Fix compile when IPv4 is not enabled 2016-03-05 15:55:53 +01:00
Dirk Ziegelmeier
f4fbc90217 netifapi: Do not pass NULL pointers for IP addresses to subsequent functions
Same as in my last commits - this avoids errors in lwIP code where ip addresses are dereferenced (e.g. for IP type checking) without handling thinking about NULL pointers.
2016-03-05 14:35:29 +01:00
Dirk Ziegelmeier
094cdf1c7b netconn: Create API macros to get/set IPV6ONLY flag 2016-03-04 23:06:33 +01:00
Dirk Ziegelmeier
bd0b51c9ef Fix my previous netconn_do_listen changes in lwip_netconn_do_listen 2016-03-03 23:16:01 +01:00
Dirk Ziegelmeier
bee5515e9a netconn API: Reimplement dual-stack API to be socket-like.
When IPv6 ANY address is used and the NETCONN_FLAG_IPV6_V6ONLY is NOT set, bind/listen on/to IP_ANY_TYPE
2016-03-03 22:52:04 +01:00
Dirk Ziegelmeier
0a7f404d09 api_lib.c: Don't propagate NULL pointers as ip address to subsequent functions 2016-03-03 22:49:55 +01:00
Dirk Ziegelmeier
0c673b6a44 Implement new style TCP dual-stack in netconn API 2016-03-02 23:46:22 +01:00
Dirk Ziegelmeier
5404ce3c0a Implement support for UDP IP_ANY_TYPE in netconn API 2016-02-29 19:31:19 +01:00
goldsimon
81c8121551 minor: fixed compiler warning "unary minus operator is applied to an unsigned expression" 2016-02-26 15:23:04 +01:00
Joel Cunningham
8cb64698aa Allow backlog to be updated
This commit adds support to the sockets and netconn layer to update the
backlog by calling listen when the netconn is already in the listen state.
When backlog is not enabled, the call returns successfully

This commit also introduces a macro for setting the backlog value that
prevents a 0 sized (invalid) backlog
2016-02-25 15:19:52 -06:00
Joel Cunningham
2a8398dfb8 Fix bug in FIONREAD handling in LINUXMODE
Fix a bug in the socket API's ioctl for FIONREAD. If the socket's
lastdata was assigned the function returned without error but did not
update the argument pointer.

The cast type for argp was also changed to int to conform with the
other SO_RCVBUF handling.
2016-02-25 12:53:12 -06:00
Dirk Ziegelmeier
9a4d7b9956 Use netif_input_fn typedef instead of creating a new one in tcpip.h 2016-02-22 21:10:50 +01:00
Dirk Ziegelmeier
fe8d2ba72f Eliminate tcpip_pppos_input function 2016-02-22 21:00:00 +01:00
Dirk Ziegelmeier
777e667f08 Add generic tcpip_inpkt function that can be called to make last changes really usable 2016-02-22 20:18:10 +01:00
Dirk Ziegelmeier
fa6f068fd1 Eliminate TCPIP_MSG_INPKT_PPPOS message type.
Fix my last commit, I accidentally unchecked the wrong file in commit dialog
2016-02-22 17:47:01 +01:00
Dirk Ziegelmeier
880f1008d6 Together with Simon: Eliminate last instances of isipv6 member in pcbs;
Don't allow NULL pointers (IPv4 ANY) in connect() and sendto() functions as destinations since this does not make sense.
2016-02-22 13:03:51 +01:00
Joel Cunningham
ea94549cb2 Optimize lwip_selscan()
This makes a couple of simple re-arrangements in lwip_selscan() that
should improve performance in the following ways:

  1) The old code linearly walked all sockets to maxfd regardless of
     whether they were set in the fd set. The process involved
     acquiring sys arch protect, looking up the socket, and then
     checking if the socket was present in any of the fd sets. On
     systems with lots of sockets and a heavy SYS_ARCH_PROTECT
     infrastructure (a mutex) this can result in a lot of extra work.
     Now we skip this process for any fd that is not in the input sets
  2) If the socket from tryget_socket() is NULL we no longer continue
     and compare the input fd sets with a zeroed out set of events
  3) We no longer need to zero out our event sets because they are
     only accessed when tryget_socket() is successful

lwip_selscan() is called at most once per select call and sometimes up to three times
2016-02-18 13:17:45 -06:00
sg
9a97a80efc Fixed bug #47154 lwip_netconn_do_writemore doesn't clear conn->write_offset on fatal/routing error. 2016-02-18 19:46:20 +01:00
Joel Cunningham
9dd1c81d41 Update lwip_selscan documentation
lwip_selscan() documentation indicated exceptset is not used, which is no
longer accurate
2016-02-12 15:00:41 -06:00
Dirk Ziegelmeier
78a36df901 Netconn: Fix potential NULL pointer dereference (found by Coverity) 2016-02-10 20:39:12 +01:00
Joel Cunningham
11faa8149e Fix blocking close with LWIP_SO_SNDTIMEO
This fixes a bug in close when LWIP_SO_SNDTIMEO is enabled, but
the option is not in use on the socket

A simple mis-typed comparison against zero would cause the close_timeout
to get set to zero if conn->send_timeout was 0

The intended check was to over-ride the default close timeout if a
send timeout had been specified via SO_SNDTIMEO
2016-01-13 22:20:52 +01:00
Axel Lin
031de097db Trivial comment fix for lwip_netconn_do_disconnect()
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-01-04 11:54:21 +01:00
Axel Lin
a3bccae173 Catch tcpip_callback call failure
tcpip_callback_with_block() can fail with ERR_MEM or ERR_VAL, and in the
error paths the code does not post the msg to the mailbox thus the
sys_sem_wait() call might wait forever. Fix it by testing return value of
tcpip_callback() and return error immediately.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2015-12-05 21:41:27 +01:00
Axel Lin
bd4c4b5959 Use SYS_ARCH_SET macro at appropriate places
Use SYS_ARCH_SET to simplify the code a bit.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2015-12-02 22:51:08 +01:00
goldsimon
8010d6706e fixed bug #46471: lwip_accept() leaks socket descriptors if new netconn was already closed because of peer behavior 2015-11-19 07:33:55 +01:00
goldsimon
98b9d31f24 Fixed compiling with LWIP_TCP==0 2015-11-16 09:37:56 +01:00
Axel Lin
ecf9d25ed0 api_msg_c: remove superfluous NETCONN_SET_SAFE_ERR call before TCPIP_APIMSG_ACK
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>
2015-11-16 09:12:29 +01:00
sg
f518c6578c fixed bug #46321: Synchronization bug around lwip_select() and tcpip_thread() with thread-local semaphores 2015-10-29 22:20:21 +01:00