Commit Graph

2113 Commits

Author SHA1 Message Date
goldsimon
a13c488e52 Fix bug #51687 (tcp_close(): is it OK to return ERR_MEM if TF_CLOSEPEND is set?)
(cherry picked from commit 1d4ca0bff6)

# Conflicts:
#	src/core/tcp.c
2017-09-15 13:19:11 +02:00
goldsimon
e8a3d42e2d Fix bug #51937 by checking TF_CLOSED at the end of all pcb callbacks in tcp_input()
(cherry picked from commit 86abfbe087)
2017-09-15 12:59:58 +02:00
goldsimon
66120f7d79 refactor tcp_input a bit in preparation of a fix for bug #51937
(cherry picked from commit a8ac37f419)

# Conflicts:
#	src/core/tcp_in.c
2017-09-15 12:59:57 +02:00
goldsimon
1d04b06450 Fixed bugs #51606 and #51535: IPv4 reassembly could be finished although there are holes
(cherry picked from commit 5ea7f507c3)

# Conflicts:
#	test/unit/Filelists.mk
#	test/unit/lwipopts.h
2017-09-15 12:52:40 +02:00
goldsimon
c51e6fbb12 Fixed bug #51623: DHCP request XID should probably be regenerated for INIT-REBOOT
(cherry picked from commit a81b19aa62)
2017-09-15 12:52:19 +02:00
goldsimon
9b19266e3d ip4_reass: fixed bug #51596 (Insufficient overlap check)
(cherry picked from commit 500598658d)
2017-09-15 12:52:18 +02:00
goldsimon
a2ac9b045a ip4_reass: fixed bug #51597 (Last fragment is assumed to have arrived even if it was discarded)
(cherry picked from commit 3dedfa3d1f)

# Conflicts:
#	src/core/ipv4/ip4_frag.c
2017-09-15 12:52:17 +02:00
goldsimon
737ed228c9 ip4_reass: fixed bug #51595 (ip_reass_pbufcount may be updated incorectly)
(cherry picked from commit f1072fee8a)

# Conflicts:
#	src/core/ipv4/ip4_frag.c
2017-09-15 12:52:04 +02:00
Matthias Hofmann
82e5a18b50 Fix using DHCP IP configuration after lease time is expired.
Signed-off-by: goldsimon <goldsimon@gmx.de>
(cherry picked from commit 9b06d71aeb)
2017-09-15 12:50:08 +02:00
Pascal Quantin
ac880ea907 Fixed bug #51528 (Bug when parsing WND_SCALE option)
Signed-off-by: goldsimon <goldsimon@gmx.de>
(cherry picked from commit 2e78b6dcae)
2017-09-15 12:49:51 +02:00
goldsimon
32aa50cfbc Fix sys_timeouts_init() for LWIP_TCP==0 (see patch #9375)
(cherry picked from commit 7b45f3fa3f)
2017-09-15 12:49:29 +02:00
Axel Lin
e6fa613633 tcp: Remove unreachable code in tcp_close_shutdown_fin
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net>
(cherry picked from commit 9bbb741247)
2017-09-15 12:49:00 +02:00
Dirk Ziegelmeier
dced7dad41 Apply patch from Kudratov Olimjon: Array index used before limits check
while ((q != NULL) && (options[offset] != DHCP_OPTION_END) && (offset < offset_max)) {
should be
while ((q != NULL) && (offset < offset_max) && (options[offset] != DHCP_OPTION_END)) {

See https://jira.reactos.org/browse/CORE-8978 for more info.
(cherry picked from commit 32aa9a41e2)
2017-09-14 09:26:33 +02:00
goldsimon
56a295f0a0 dhcp_parse_reply: return ERR_VAL instead of asserting on offset-out-of-pbuf
(cherry picked from commit 33466ee6a8)
2017-09-14 09:23:56 +02:00
goldsimon
f5438b1b43 try to satisfy clang's '-Wempty-body'
(cherry picked from commit aef2accfa3)
2017-09-14 09:16:42 +02:00
goldsimon
282e85763b 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)
(cherry picked from commit 946b231516)
2017-09-14 09:06:34 +02:00
Dirk Ziegelmeier
b307fea1b9 Rename "IPv6 mapped IPv4 addresses" to their correct name from RFC4191: "IPv4-mapped IPv6 address"
(cherry picked from commit 4d8fec3b67)

Conflicts:
	src/core/ipv6/ip6.c
2017-03-13 09:28:46 +01:00
goldsimon
19d56b4096 tcp: watch out for pcb->nrtx overflows and tcp_backoff indexing overflow
(cherry picked from commit 7ffe5bfb3c)
2017-03-13 09:14:23 +01:00
David van Moolenbroek
66db517a28 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.

(cherry picked from commit 5827c168c2)
2017-03-13 09:14:22 +01:00
Joel Cunningham
2452bc9336 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

(cherry picked from commit b90a54f989)
2017-03-13 09:13:41 +01:00
goldsimon
563932b888 tcp: fixed bug #50418: LWIP_EVENT_API: fix invalid calbacks for SYN_RCVD pcb
# Conflicts:
#	CHANGELOG
2017-03-01 22:15:07 +01:00
goldsimon
8849a443a4 pbuf_ref: assert-check for 'ref' overflow
(cherry picked from commit 76763c9bcd)
2017-02-27 12:31:13 +01:00
goldsimon
e318688195 Improved DNS_LOCAL_HOSTLIST interface (bug #50325)
(cherry picked from commit deaa6e9406)

Conflicts:
	CHANGELOG
2017-02-27 12:30:38 +01:00
Joel Cunningham
4d1d567ab7 Fix comment typo from bug #47485
tcp_close_shutdown_impl() should be tcp_close_shutdown_fin()

(cherry picked from commit 0b257f71e7)
2017-02-27 12:28:18 +01:00
goldsimon
8927cda2f8 For tiny targtes, LWIP_RAND is optional -> fix compile time checks
(cherry picked from commit 693a74c286)
2017-02-27 12:27:47 +01:00
David van Moolenbroek
0a3e4cd10e tcp: fix accept event on closed listening PCBs
If LWIP_CALLBACK_API is not defined, but TCP_LISTEN_BACKLOG is, then
the LWIP_EVENT_ACCEPT TCP event may be triggered for closed listening
sockets.  This case is just as disastrous for the event API as it is
for the callback API, as there is no way for the event hook to tell
whether the listening PCB is still around.  Add the same protection
against this case for TCP_LISTEN_BACKLOG as was already in place for
LWIP_CALLBACK_API.

Also remove one NULL check for LWIP_CALLBACK_API that had already
become redundant for all callers, making the TCP_EVENT_ACCEPT code
for that callback wrapper more in line with the rest of the wrappers.

(cherry picked from commit 240cf62056)
2017-02-27 12:25:52 +01:00
Dirk Ziegelmeier
76efa271e6 Implement task #14367: Hooks need a better place to be defined
We now have a #define for a header file name that is #included in every .c file that provides hooks.
2017-02-27 12:25:08 +01:00
goldsimon
b3293d903e Fixed bug #47485 (tcp_close() should not fail on memory error) by retrying to send FIN from tcp_fasttmr
(cherry picked from commit bc07fd9db5)

Conflicts:
	CHANGELOG
2017-02-27 12:24:51 +01:00
Dirk Ziegelmeier
5ef8a3cb60 igmp.c: igmp_lookup_group() should be static
(cherry picked from commit 702091d548)
2017-02-27 12:23:39 +01:00
Luc Revardel
dc38e21a70 Fix bug #50220 (mld6_leavegroup does not send ICMP6_TYPE_MLD, even if last reporter)
Signed-off-by: sg <goldsimon@gmx.de>
(cherry picked from commit 819bfbb943)
2017-02-27 12:22:41 +01:00
David van Moolenbroek
d471e5f89e Patch #9250 (slightly changed): fix source substitution in ip6_output_if() (broken in 2014 with be75c483d0)
Signed-off-by: sg <goldsimon@gmx.de>
(cherry picked from commit fffd61c746)
2017-02-27 12:22:03 +01:00
sg
99ef13f2be Fixed bug #50090 (ast_unsent->oversize_left can become wrong value in tcp_write error path)
(cherry picked from commit 21737f57e5)
2017-02-27 12:21:31 +01:00
Dirk Ziegelmeier
bb2b2be454 Fix bug #50206: UDP Netconn bind to IP6_ADDR_ANY fails
The tests were in to catch user errors, but they seem to get in the way of application programming :-)
The checks in *_send() remain active to catch when PCB source and destination address types do not match

(cherry picked from commit ff04c2046e)
2017-02-27 12:20:01 +01:00
Axel Lin
d6e8e05edd stats: Remove superfluous /t in end of stats display
The debug message after the stats display looks odd because the /t in end of
stats display.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
(cherry picked from commit 2685d742e8)
2017-02-27 12:19:08 +01:00
Dirk Ziegelmeier
777d54f0e4 Retry 1 to fix bug #50064
Accidentally used the wrong destination HW addr

(cherry picked from commit 645ca84704)
2017-02-27 12:17:41 +01:00
Dirk Ziegelmeier
8c6ac8eb59 Optimize my last fix in etharp.c, I missed the variable declaration at the beginning of the function
(cherry picked from commit 7aaa888d1d)
2017-02-27 12:17:41 +01:00
Dirk Ziegelmeier
4fc3770278 Remove special ARP reply optimization from etharp.c
- Code duplication with etharp_raw()
- No great effect on perfomance
- May make reworking PBUF handling code more complicated (see bug #49914)
- The check for p->type == PBUF_REF is a strange special case, too
- Simon also voted to remove it

(cherry picked from commit 47bac3c11f)
2017-02-27 12:17:40 +01:00
Dirk Ziegelmeier
e53c84654e Fix bug #50064: Zero-copy RX: ARP reply fails with PBUF_REF
Kept the optimized version intact, see discussion in savannah bug tracker

(cherry picked from commit 199c38de29)
2017-02-27 12:17:40 +01:00
Axel Lin
90d68b41df tcp_out: Use LWIP_MIN instead of open-coded for better readability
Make the intention of code more clear by using LWIP_MIN instead of open-coded.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
(cherry picked from commit 141b5def46)
2017-02-27 12:16:17 +01:00
Axel Lin
e6756387b0 tcp_out: Fix comment for last_unsent->oversize_left and tcp_pcb.unsent_oversize
Both last_unsent->unsent_oversize and tcp_pcb.unsent_oversized fields are not
exist, fix the comments.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
(cherry picked from commit 30aedfc3f7)
2017-02-27 12:16:17 +01:00
Dirk Ziegelmeier
4fe1436904 Add some parentheses for better code readability in tcp_in.c
(cherry picked from commit df8e404abd)
2017-02-27 12:16:16 +01:00
Dirk Ziegelmeier
1fdbda9700 Fix bug #50040: pbuf_alloc(..., 65534, PBUF_RAM) succeeds
Check for integer overflow when calculating memory allocation size
(cherry picked from commit 9898d406bc)
2017-02-27 12:16:16 +01:00
Dirk Ziegelmeier
fed15778dd Minor typo fix in tcp_out.c
(cherry picked from commit 0043bf78b6)
2017-02-27 12:16:16 +01:00
Axel Lin
bbe91e356f tcp_out: Fix oversize vs. space assertion test
oversize_used is always 0 at this point, should test oversize instead.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
(cherry picked from commit e1598b0b11)
2017-02-27 12:16:15 +01:00
Dirk Ziegelmeier
e94c9ffa70 Fix warning about bad cast in pbuf_skip() 2017-01-05 08:14:39 +01:00
Dirk Ziegelmeier
72316bdb5b Move macros to access DHCP and AUTOIP data to headers, users may want to access the members 2017-01-05 08:09:00 +01:00
Dirk Ziegelmeier
803a711e6a Fix warning that local variable may be used uninitialized in mem.c 2017-01-05 08:07:41 +01:00
Axel Lin
1f3c18fcbe tcp: Make tcp_listen_with_backlog_and_err return NULL if the address/port is already used
The caller of tcp_listen_with_backlog_and_err() usually check if the return
pcb is NULL before checking the err reason. I think the commit adding
tcp_listen_with_backlog_and_err() accidently change the behavior, Fix it.

Fixes: 98fc82fa71 ("added function tcp_listen_with_backlog_and_err() to get the error reason when listening fails")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2017-01-01 19:53:51 +01:00
sg
a2a16d4193 nd6 rdnss: fixed dual-stack compilation 2016-12-31 15:51:59 +01:00
sg
98fc82fa71 added function tcp_listen_with_backlog_and_err() to get the error reason when listening fails (bug #49861) 2016-12-31 15:36:31 +01:00