Commit Graph

5231 Commits

Author SHA1 Message Date
Dirk Ziegelmeier
2d9ef2215b Fix bug #50576: LWIP_NSC_IPV4_GATEWAY/NETMASK/SETTINGS_CHANGED should check if the setting is actually being changed 2017-03-18 15:30:20 +01:00
goldsimon
972b7c2bfd sys_arch unit tests: refine test_sys_arch_waiting_fn a bit 2017-03-18 10:22:44 +01:00
Joel Cunningham
81e4726607 test_socket: conditional compile buffer trailer code
This code is marked as dead when BUF_SZ is a multiple of 4 (current
situation with unit tests)

This hopefully fixes a -Wunreachable-code failure found by Travis CI
2017-03-17 17:12:12 -05:00
Joel Cunningham
0a5a18e703 test_socket: add sendmsg/recvmsg TCP test
This migrates the sendmsg TCP test from socket examples (task #14408)
to socket unit tests

Additionally, this adds support for testing recvmsg, creating a TCP
test for both sendmsg/recvmsg (referred to as msgapi test)

This also makes a small change to msgapi UDP to clear the receive
buffer after verifying the previous datagram
2017-03-17 16:47:44 -05:00
Joel Cunningham
551d76eadd test_sockets: move loopback addr logic to utility function
This moves the loopback address creation logic to a utility function
so it can be shared with forth coming message API TCP test
2017-03-17 14:52:05 -05:00
Joel Cunningham
4c78ec7931 test_socket: replace {0} with memset
Using {0} broke Travis CI even though this should be correct for
initializing struct msghdr (see example in Linxu man pages:
http://man7.org/linux/man-pages/man3/cmsg.3.html)

Just use memset for now which is the common approach in LwIP codebase
2017-03-17 14:44:47 -05:00
Joel Cunningham
02e957de1e test_socket: convert sendmsg test to use recvmsg
This converts the sendmsg test to use recvmsg for receiving, thus
exercising both sendmsg and recvmsg in a single test

This also adjusts the test naming to communicate all message APIs
(sendmsg/recvmsg) are being tested
2017-03-17 14:19:26 -05:00
goldsimon
aef2accfa3 try to satisfy clang's '-Wempty-body' 2017-03-17 11:22:30 +01:00
goldsimon
dffb75c5fa test_sockets: fix warning about unused variable "addr_size" 2017-03-17 11:03:49 +01:00
Dirk Ziegelmeier
59fba75cd8 Update doxygen version to 2.0.3 as in init.h 2017-03-17 09:55:04 +01:00
goldsimon
aa129f35a2 hopefully fix building unit tests on linux/clang 2017-03-17 09:29:06 +01:00
goldsimon
e1d818bb5f sockets unit tests: removed commented-out test code :-/ 2017-03-17 09:26:58 +01:00
goldsimon
b0444a63b0 tried to fix sockets unit tests; fix configuration to run with any NO_SYS setting and with/without IPv6 (IPv4 is required) 2017-03-17 09:05:36 +01:00
goldsimon
a42d1678eb tcp unit tests: don't break later tests relying on loopif 2017-03-17 08:56:03 +01:00
goldsimon
3fd8440ab9 memp.h: added missing include 2017-03-17 08:55:10 +01:00
goldsimon
d9a738d85f sockets: fix lwip_getsockname/lwip_getpeername for dual-stack: ip_addr_t type "any" (dual) has to be converted to AF_INET6 2017-03-17 08:54:51 +01:00
Joel Cunningham
53fcd50870 task #14408: move sendmsg UDP to unit tests
This commit moves the sendmsg UDP test from socket examples to socket
unit tests

The test has been converted to send/receive on the loopback interface
and also test a connected sendmsg with NULL msg_name
2017-03-16 19:27:26 -05:00
goldsimon
d820fb2f8d Try to add a Filelists.mk file for the unit tests (to fix unix build of unit tests) 2017-03-16 22:54:50 +01:00
goldsimon
fc47f846ed Fix and improve sockets unit test and unit test sys_arch (with a little help of tcpip.c) 2017-03-16 22:49:38 +01:00
goldsimon
8313c4d870 tried to add basic socket unit tests (nonsense only for now); made LOCK_TCPIP_CORE()/UNLOCK_TCPIP_CORE() overridable for that 2017-03-16 21:52:30 +01:00
goldsimon
2d8e17aa89 sockets: guard declaration of 'lwip_select()' with LWIP_SOCKET_SELECT==1 2017-03-16 09:18:53 +01:00
goldsimon
e71dbec587 bridgeif: fix compiling with NO_SYS==1 by changing default value of BRIDGEIF_PORT_NETIFS_OUTPUT_DIRECT 2017-03-16 09:18:28 +01:00
Dirk Ziegelmeier
b9a40a5163 Fix coding style NO_SYS example code 2017-03-15 20:16:52 +01:00
Dirk Ziegelmeier
da0714d7cb Fix starting DHCP in NO_SYS example code 2017-03-15 20:09:39 +01:00
Dirk Ziegelmeier
d9b279d150 Cleanup documentation a bit: rename "Addons" to "NETIFs" - its a more appropriate name 2017-03-15 20:03:55 +01:00
Dirk Ziegelmeier
6328da87aa Add bridge interface to documentation 2017-03-15 19:58:32 +01:00
goldsimon
2dcf31d6b1 bridgeif: better separation between bridgeif and fdb (todo: move fdb to contrib?), tried to fix the build for LWIP_NUM_NETIF_CLIENT_DATA==0 2017-03-15 16:50:55 +01:00
goldsimon
946b231516 lwip_init(): at least IAR warns about "LWIP_UNUSED_ARG(a)" accessing an uninitialized variable... Try to fix this by initializing it (it will be optimized away anyway) 2017-03-15 16:47:59 +01:00
goldsimon
51a07661cc Added a simple multi-netif 802.1d bridge implementation to show that a multi-port netif works (see task #14369) 2017-03-15 12:31:12 +01:00
Dirk Ziegelmeier
1f1f2e1c46 Try to fix line endings of tftp_server.c in git rep 2017-03-14 09:12:25 +01:00
goldsimon
754e49643f set version to 2.0.3.dev now that 2.0.2 is released 2017-03-14 09:06:06 +01:00
goldsimon
eb1aadb218 implement udp/raw recvmsg() by moving recvfrom() into a common function taking an array of iovecs... (IP_PKTINFO/in_pktinfo still missing) 2017-03-13 22:31:17 +01:00
Dirk Ziegelmeier
59973c96e4 Fix bug #50534: TFTP server does not copy terminating null of filename
Patch by David Rodgers
2017-03-13 21:26:06 +01:00
goldsimon
cb1a271c61 lwip_recvmsg: MSG_PEEK must be limited to the first iov for TCP 2017-03-11 20:42:59 +01:00
goldsimon
15918d8971 mdns.txt: changed the LWIP_MDNS_STRNCASECMP text again to reflect the fact that there are 2 names for 1 function... 2017-03-11 20:35:58 +01:00
Dirk Ziegelmeier
1371400c2b mdns_domain_add_label_base should be static 2017-03-11 10:41:47 +01:00
goldsimon
681951c175 mdns.txt: LWIP_MDNS_STRNCASECMP -> lwip_strnicmp 2017-03-10 23:03:45 +01:00
goldsimon
7bcb4eafec mdns: minor(?) stack usage and performance improvement by letting mdns_readname_loop() copy from pbuf to struct (instead of pbuf->buffer->struct) 2017-03-10 23:00:46 +01:00
goldsimon
5752b24d38 fix bug #50503: LWIP_NETCONN_FULLDUPLEX: some LWIP_ERROR paths don't call done_socket() 2017-03-10 11:52:59 +01:00
Joel Cunningham
8bf402fd67 Fix unit test with assumed congestion avoidance
test_tcp_fast_rexmit_wraparound correctness relied on the congestion
window being in congestion avoidance so that only a single TCP_MSS
segment is sent upon ACKing the first segment.

It's not known whether the test was relying tcp_alloc() to set ssthresh
to 0 and thus start in congestion avoidance or if the test was working by
accident until changes in b90a54f989

This fixes the test by enforcing the requirement of starting in
congestion avoidance

Signed-off-by: goldsimon <goldsimon@gmx.de>
2017-03-10 08:12:17 +01:00
goldsimon
1b14c2e7b0 sockets: fix printf warning in gcc 2017-03-10 07:56:14 +01:00
goldsimon
2c77560870 My first try at 'recvmsg()', TCP only, for now... 2017-03-09 21:49:55 +01:00
goldsimon
e9e9ec23b8 tcp unit tests: fixed that tcp_teardown() could lead to accessing a netif pointer that is not valid any more (netif added in test function stored on stack) 2017-03-09 20:23:16 +01:00
goldsimon
7ffe5bfb3c tcp: watch out for pcb->nrtx overflows and tcp_backoff indexing overflow 2017-03-09 13:29:41 +01:00
David van Moolenbroek
5827c168c2 tcp: do not keep sending SYNs when getting ACKs
If a locally generated TCP SYN packet is replied to with an ACK
packet, lwIP immediately sends a RST packet followed by resending the
SYN packet.  This is expected, but on loopback interfaces the resent
SYN packet may immediately get another ACK reply, typically when the
other endpoint is in TIME_WAIT state (which ignores the RSTs).  The
result is an endless loop of SYN, ACK, RST packets.

This patch applies the normal SYN retransmission limit in this
scenario, such that the endless loop is limited to a brief storm.
2017-03-09 13:22:49 +01:00
Joel Cunningham
b90a54f989 bug #50476: initialize ssthresh to TCP_SND_BUF
This commit changes ssthresh to be the largest effective congestion
window (amount of in-flight data). This follows the guidance of RFC
5681 which recommends setting ssthresh arbitrarily high.

LwIP was previously using the receive window value at the end of the
3-way handshake and in the case of an active open where the receiver
used window scaling and/or window auto-tuning, this resulted in a very
small ssthresh value even though the window ramped up once the connection
was established
2017-03-08 16:36:35 -06:00
Joel Cunningham
fd9ac30062 Fix dual-stack build failure in lwip_sendmsg
This corrects a typo introduced in c9d0192b4a
that broke the build for dual-stack (IPv4 and IPv6)
2017-03-08 16:34:49 -06:00
Sylvain Rochet
e16d10ade6 PPP: remove unused and confusing return values other than ERR_OK for ppp_connect and ppp_listen
User should not use ppp_connect or ppp_listen return value to retry
later, it must wait for the callback to be called. This is primarily
done this way to have a consistent behavior with and without the
holdoff feature.

Remove returned error value from PPP link level API connect and listen
callbacks because we are not using them anymore, then make ppp_connect
or ppp_listen to always return ERR_OK, thus we are not breaking the PPP
user API.

We don't need the return code here, all PPP link level drivers can't
fail at all (e.g. PPPoS) or retry if necessary (PPPoE and PPPoL2TP).
2017-03-08 22:17:40 +01:00
goldsimon
aff1935e40 arch.h: include <limits.h> if it exists (at least INT_MAX is used) 2017-03-08 20:30:48 +01:00
goldsimon
c9efb7a72c added missing define for MSG_NOSIGNAL 2017-03-08 19:57:10 +01:00