Commit Graph

6199 Commits

Author SHA1 Message Date
goldsimon
ef3073aaf9 LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT: 'lfree' mus be volatile 2018-04-18 22:12:46 +02:00
goldsimon
71c13c6079 Improve the socket stress test to better test fullduplex 2018-04-18 22:03:11 +02:00
goldsimon
3abc8ae161 LWIP_NETCONN_FULLDUPLEX: unblock rx threads on close
Threads blocked on the rx mbox are counted and on close,
one "netconn closed" message per thread is posted to the mbox
to ensure all threads are woken.

The netconn can then be safely deleted. In socket API, "fd_used"
and "fd_free_pending" help with auto-deleting the netconn.

Signed-off-by: goldsimon <goldsimon@gmx.de>
2018-04-18 21:51:34 +02:00
goldsimon
41fea4ad7d sockets: change closing: netconn is freed when socket is closed, not before
This is necessary to implement fullduplex sockets that are closed asynchronously:
the netconn in the socket must not be freed before all threads have given up
using it.

We now call the first part of 'netconn_delete()' (moved to 'netconn_prepare_delete()')
from lwip_close() and only actually end up calling 'netconn_free()' from
'free_socket()', which might be called later if LWIP_NETCONN_FULLDUPLEX is enabled.

Signed-off-by: goldsimon <goldsimon@gmx.de>
2018-04-18 20:55:49 +02:00
goldsimon
1090e9cdec LWIP_NETCONN_FULLDUPLEX: prevent taking recursive sys arch lock
Calling SYS_ARCH_PROTECT() could happen twice in 'free_socket()' if
that free was executed delayed (e.g. in 'done_socket_locked()').

Signed-off-by: goldsimon <goldsimon@gmx.de>
2018-04-18 20:55:49 +02:00
goldsimon
b1fe8cf4b8 netbiosns: check question type before generating an answer 2018-04-18 08:17:10 +02:00
goldsimon
f65911a84b netbios: fix response length of node status response 2018-04-18 07:28:41 +02:00
Dirk Ziegelmeier
66800925cf Fix indent in netbiosns.c 2018-04-17 14:08:59 +02:00
Dirk Ziegelmeier
533c97f0c3 Fix bug #53626: NetBIOS Responder generates malformed packet responding to "*" name
Implement corrected answer packet
2018-04-16 10:40:05 +02:00
Axel Lin
e935faf2bc tcp_priv.h: Fix compile warnings when TCP_DEBUG_PCB_LISTS is set
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-04-10 17:48:47 +08:00
goldsimon
fa55458c42 netconn_accept: reduce number of ifdefs 2018-04-06 22:37:20 +02:00
goldsimon
4cc953d0e3 httpd: fixed compiling makefsdata.c 2018-04-04 21:45:47 +02:00
Dirk Ziegelmeier
ffdd44ec74 Fix bug #53559: IPv4 to IPv6 filtering not freeing PBUFs
Add missing pbuf_free() call
2018-04-04 21:04:14 +02:00
Ray Abram
b0ae967660 NetBIOS Responder should respond to "*" names
See bug #53325

Signed-off-by: goldsimon <goldsimon@gmx.de>
2018-04-03 22:19:18 +02:00
Tom Ferrin
82d8f08451 Add "server reachability" register to SNTP
Guarded with SNTP_MONITOR_SERVER_REACHABILITY (sntp_opts.h).
See patch 9581

Signed-off-by: goldsimon <goldsimon@gmx.de>
2018-04-03 21:56:33 +02:00
Tom Ferrin
e46b9ad4ac sntp: store server IP address after DNS lookup
See patch #9612

Signed-off-by: goldsimon <goldsimon@gmx.de>
2018-04-03 21:16:05 +02:00
Giuseppe Modugno
2d4da92eeb makefsdata: added options to skip and avoid compressing some extensions
See patch #9605

Signed-off-by: goldsimon <goldsimon@gmx.de>
2018-04-03 21:08:25 +02:00
Axel Lin
81acaf0ff1 tcp_out: Fix updating remainder_flags in tcp_split_unsent_seg
The code to migrate flags from original segment updating wrong variable
so both remainder and remainder_flags may be incorrect. Fix it.

Fixes: f582c88339 ("tcp: persist timer re-work (bug #50837)")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Joel Cunningham <joel.cunningham@me.com>
2018-03-31 11:20:03 +08:00
goldsimon
b693056bb6 lowpan6_ble: local address is required for compression/decompression, too 2018-03-27 21:20:01 +02:00
goldsimon
97a9fe1b10 Fix compiling lowpan6_ble.c on travis 2018-03-22 08:48:53 +01:00
Axel Lin
e9ee3c4b58 add lowpan6_common.c to Filelists.mk
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-03-22 08:39:20 +08:00
goldsimon
8adfc730ec lowpan6_ble.c: use common functions from lowpan6_common.c 2018-03-21 22:57:45 +01:00
goldsimon
ac03107036 lowpan6_common.c: add comments from ble version 2018-03-21 22:53:08 +01:00
goldsimon
a4b9beef04 Move common 6LoWPAN code to new file lopwan6_common.c
This is mainly IPHC (de)compression.

TODO: adapt the 6LoWPAN-over-BLE netif to this.

Signed-off-by: goldsimon <goldsimon@gmx.de>
2018-03-21 20:55:05 +01:00
goldsimon
c974fc9d43 http_client: fix compiling if mem_size_t is smaller than size_t 2018-03-21 09:33:00 +01:00
goldsimon
c881c48eed netif_add: check that the new netif is not already added 2018-03-21 09:32:39 +01:00
Axel Lin
600527dde7 apps/http: httpd: Fix unused parameter warning if !LWIP_HTTPD_SUPPORT_V09
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-03-21 15:05:33 +08:00
Axel Lin
e19d908f0e apps/http: Fix httpd_structs.h build error
Fixes: bug #53382: HTTPD_ADDITIONAL_CONTENT_TYPES doesn't compile
Reported-by: Giuseppe Modugno <giuseppe.modugno.loqed@gmail.com>
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-03-19 21:08:17 +08:00
Dirk Ziegelmeier
104a629a51 zepif: Convert to dual-stack 2018-03-15 09:21:32 +01:00
goldsimon
d79416eee6 lowpan6: move a function to delete one prototype 2018-03-14 16:59:20 +01:00
Axel Lin
6070a7ef6a netif: Add netif_do_ip_addr_changed function to reduce duplicated code
As the common code to call tcp/udp/raw_netif_ip_addr_changed is called
by multiple places, add netif_do_ip_addr_changed() to call them.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-03-14 22:59:17 +08:00
goldsimon
08bcfa2b29 netif: initialize netif->output with a dummy function for IPv6 only netifs 2018-03-13 20:29:37 +01:00
goldsimon
0074022bb5 minor: fix typos and spaces 2018-03-13 20:28:59 +01:00
Axel Lin
10ae311a93 lowpan6: Rework to speed up dequeue datagram process
Current implementation iterates the lowpan6_data.reass_list every time
dequeue_datagram() is called.
We can get previous lrh in all the context calling dequeue_datagram().
By adding a prev arguemnt to dequeue_datagram(), we can speed up the
dequeue datagram process.

All the callers never check return value of dequeue_datagram() as it
always return ERR_OR, thus make it return void instead.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-03-13 08:16:35 +08:00
Axel Lin
909037c2ca api_lib: Remove superfluous #if LWIP_TCP in netconn_recv_data_tcp
netconn_recv_data_tcp() will be built only when LWIP_TCP=1.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-03-11 16:47:14 +08:00
goldsimon
16afe566ff lowpan6: fix doc warning in clang 2018-03-09 13:40:15 +01:00
goldsimon
253fcc8dcd http_client: call tcp_recved for header bytes
Without this, closing the connection after successful transfer resulted
in a RST being sent because the window was not fully marked as 'recved'.

Signed-off-by: goldsimon <goldsimon@gmx.de>
2018-03-09 11:30:23 +01:00
goldsimon
8d8572354b lowpan6: fix bug #47291 (wrong datagram size for fragmentation)
Fragment datagram_size and datagram_offset should be calculated from the uncompressed datagram.
We did this on the compressed size and thus were not compatible to other implementations.
Now my test setup communicates with contiki sicslowpan.

Signed-off-by: goldsimon <goldsimon@gmx.de>
2018-03-09 11:28:35 +01:00
goldsimon
b86f9b97e0 lowpan6: refactor decompression to not allocate a pbuf 2018-03-09 06:37:59 +01:00
goldsimon
61a1b98cc9 various IPv6-only compile fixes 2018-03-07 20:55:00 +01:00
goldsimon
972f32dd47 zepif: fix compiling with IPv4 disabled 2018-03-07 19:58:09 +01:00
Axel Lin
971404ff90 http_client.h: Include lwip/pbuf.h
struct pbuf is used by httpc_headers_done_fn, thus need to include
lwip/pbuf.h.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-03-07 15:24:14 +08:00
Axel Lin
0411332856 api_msg.h: Fix build error when LWIP_NETIF_API && !LWIP_SOCKET && !LWIP_NETCONN
netifapi related lwIP internal definitions should be guarded
by #if LWIP_NETIF_API rather than #if LWIP_NETCONN || LWIP_SOCKET.

Fix below build errors:
cc -g -DLWIP_DEBUG -Wall -pedantic -Wparentheses -Wsequence-point -Wswitch-default -Wextra -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wc++-compat -Wwrite-strings -Wold-style-definition -Wcast-align -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Wunreachable-code -Wuninitialized -Wmissing-prototypes -Wredundant-decls -Waggregate-return -Wlogical-not-parentheses -Wlogical-op -Wc90-c99-compat -Wtrampolines -I. -I../../..  -I../../../../lwip/src/include -I../../../ports/unix/port/include -I../../../../mbedtls/include -Wno-redundant-decls -DLWIP_HAVE_MBEDTLS=1 -c ../../../../lwip/src/api/netifapi.c In file included from ../../../../lwip/src/api/netifapi.c:46:0:
../../../../lwip/src/include/lwip/netifapi.h:76:50: error: unknown type name 'netifapi_void_fn'; did you mean 'netif_init_fn'?
 err_t netifapi_netif_common(struct netif *netif, netifapi_void_fn voidfunc,
                                                  ^~~~~~~~~~~~~~~~
                                                  netif_init_fn
../../../../lwip/src/include/lwip/netifapi.h:77:29: error: unknown type name 'netifapi_errt_fn'; did you mean 'netif_input_fn'?
                             netifapi_errt_fn errtfunc);
                             ^~~~~~~~~~~~~~~~
                             netif_input_fn
../../../../lwip/src/api/netifapi.c: In function 'netifapi_do_netif_add':
../../../../lwip/src/api/netifapi.c:67:22: error: dereferencing pointer to incomplete type 'struct netifapi_msg'
   if (!netif_add( msg->netif,
                      ^~

Fixes: 30a2283993 ("Move netifapi private definitions to priv/api_msg.h")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-03-07 07:58:10 +08:00
goldsimon
b6d9bb6b2a http_client: check current state when receiving FIN 2018-03-06 21:51:13 +01:00
goldsimon
91a2d9e237 zepif: fix comment for calling netif->input() 2018-03-05 08:40:51 +01:00
goldsimon
5474498f7e zepif: call netif->input instead of tcpip_6lowpan_input for rx packets
This allows reusing zepif e.g. with contiki 6LoWPAN code for testing.
2018-03-05 06:43:57 +01:00
Joel Cunningham
b28e979739 unit: write out XML file
This writes out the results of the unit tests in an XML file called
lwip_unittests.xml in the same directory as the unittests executable.

See https://libcheck.github.io/check/doc/check_html/check_4.html#XML-Logging
for an example of the ouput. Of particular use is the duration field, for
each test and for the entire test run.
2018-03-04 10:42:54 -06:00
Axel Lin
53ddb9244b apps/sntp: Trivial build warning fix
Fix below build warning:
../../../../lwip/src/apps/sntp/sntp.c: In function ‘sntp_servermode_dhcp’:
../../../../lwip/src/apps/sntp/sntp.c:726:3: warning: ISO C90 forbids mixed declarations and code [-Wc90-c99-compat]
   u8_t new_mode = set_servers_from_dhcp ? 1 : 0;
   ^~~~

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-03-04 19:18:26 +08:00
Joel Cunningham
b1258bf8e6 unit: speed up test_pbuf_queueing_bigger_than_64k
Speed up test_pbuf_queueing_bigger_than_64k by using memcmp rather than
a byte by byte comparision. This allows using word aligned compares
within the memcmp implementation

This fixes a unit test timeout on my Windows 10 box with WSL which was
taking longer than 4 seconds for the unix port unit test to complete

See failure details in https://savannah.nongnu.org/patch/index.php?9579
2018-03-03 17:43:23 -06:00
Dirk Ziegelmeier
91038e4979 Improve 6LoWPAN documentation 2018-03-03 11:09:57 +01:00