Commit Graph

5059 Commits

Author SHA1 Message Date
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
goldsimon
c797222407 lwip_sendmsg: implement EMSGSIZE checks 2017-03-07 21:48:59 +01:00
goldsimon
c9d0192b4a lwip_sendmsg: small performance improvement: netbuf can be allocated on the stack as it is used internally only (see lwip_sendto) 2017-03-07 21:43:23 +01:00
goldsimon
270fdfff07 netconn_write_vectors_partly() watch out for overflow of data to send (must fit into INT_MAX for sockets) 2017-03-07 21:30:03 +01:00
goldsimon
4dd378b126 socket sendto: gracefully handle 'size' not fitting into an u16_t (return EMSGSIZE error) see task #14378 2017-03-07 20:56:37 +01:00
goldsimon
5c33efe430 minor: indentation fix 2017-03-07 20:37:52 +01:00
goldsimon
194803a3a7 netbuf: correctly reset netbuf checksum for LWIP_CHECKSUM_ON_COPY==1 2017-03-07 20:37:06 +01:00
goldsimon
c6c693923e One more try to fix the build... 2017-03-07 09:45:01 +01:00
goldsimon
53f717338b sockets: fixed printf format (not reported by mingw port due to -Wno-format) 2017-03-07 08:59:26 +01:00
goldsimon
b71d4477ea socket tcp performance tweak: handle window update (call into tcpipi_thread) only once per recv for multi-segment receives 2017-03-06 22:22:22 +01:00
goldsimon
f0bc2fa968 netconn_tcp_recvd should take u32_t, not u16_t (as used in msg) 2017-03-06 22:20:41 +01:00
goldsimon
f02119af62 lwip_recvfrom: fix tcp socket error handling 2017-03-06 22:13:58 +01:00
goldsimon
04bff63f49 sockets: netconn event callback is only used for select (nonblocking sockets are now implemented at netconn layer) -> add option LWIP_SOCKET_SELECT to reflect this 2017-03-06 22:06:53 +01:00
goldsimon
c77a7fe824 lwip_recv_tcp: fix full-duplex: remove invalid calls to done_socket() 2017-03-06 22:03:02 +01:00
goldsimon
30be7b582e sockets: remove sock->lastoffset and free unused pbufs instead (using pbuf_free_header) 2017-03-06 21:54:50 +01:00
goldsimon
49414826af pbuf: added new function pbuf_free_header() to gradually hide bytes and free pbufs from the front of a pbuf chain 2017-03-06 21:53:48 +01:00
goldsimon
c295717ce7 sockets: clean up all the if/else in lwip_recvfrom and use new nonblocking features in netconn API: I'm OK with code duplication if it gets more readable :-/ 2017-03-06 21:50:42 +01:00
goldsimon
1945582c10 netconn: added receive flag NETCONN_NOAUTORCVD and netconn_tcp_recvd() to delay rx window updates (e.g. when receiving more data as performance improvement) 2017-03-06 21:33:35 +01:00
goldsimon
b86787c39c Improve code readability by moving tcp-specific functionality from netconn_recv_data() to new static function netconn_recv_data_tcp() since all tcp code paths are different anyway 2017-03-06 21:27:33 +01:00
Dirk Ziegelmeier
e15e504217 Some minor SNMPv3 related cleanups 2017-03-06 09:38:58 +01:00
Joel Cunningham
dd4ded3978 do_writemore: fix blocking bug
A bug was introduced in the atomic vector feature for blocking netconns
where if we couldn't write the entire vector due to send buffer being
full (write_more is 0), we would not update the vector state and then
when sent_tcp() is called, it would actually re-send the previous vector
and if additional calls were required to finish the write, msg.w.offset
would eventually exceed msg.w.len, This was found by testing "stats"
from the shell and hitting the LWIP_ASSERT in do_writemore() that
checks offset < len

The fix simply updates the vector state after every ERR_OK return from
tcp_write().  While not all cases (non-blocking sockets) need to update
the state in this case, it keeps the logic simple and also makes
debugging simpler because you don't have stale vector state at any
point
2017-03-04 12:34:44 -06:00
Dirk Ziegelmeier
02be2f8f42 Move snmpv3_dummy.* from main lwIP rep to contrib 2017-03-03 13:42:37 +01:00
Dirk Ziegelmeier
9719c52e62 SNMPv3: Missed two locations where the new enums can be used 2017-03-03 13:21:22 +01:00