Commit Graph

6299 Commits

Author SHA1 Message Date
Simon Goldschmidt
0c209dba4b ethernet_input: fixed duplicate check for p->len
See bug #54195.

Reported-by: Andrey Vinogradov <andrey.vinogradov@teplomonitor.ru>
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-27 20:51:10 +02:00
Simon Goldschmidt
f3e14585ad tcp_out: fix duplicate check of tcp snd_queuelen
Can be combined into a single check using LWIP_MIN.
See bug #54194

Reported-by: Andrey Vinogradov <andrey.vinogradov@teplomonitor.ru>
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-27 20:44:01 +02:00
Simon Goldschmidt
8435fbb048 doc: IP_REASS_MAX_PBUFS is used for ipv6, too
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-27 20:44:01 +02:00
Axel Lin
4027a2ae58 Introduce lwip_toupper and use it in netbiosns.c
This fixes build error when LWIP_NO_CTYPE_H=1.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-27 23:16:03 +08:00
Axel Lin
a56e61c942 Fix compiling with LWIP_NOASSERT defined
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-06-24 18:18:35 +08:00
Simon Goldschmidt
d80e84864e httpd deduplicate code in http_send_data_ssi
Keep lead-in/lead-out tag in an array
2018-06-22 22:23:26 +02:00
Lucas Vinicius Hartmann
0acf37fd75 Added JavaScript-friendly ssi /*#tag*/. 2018-06-22 22:06:14 +02:00
Simon Goldschmidt
58f928a181 lwiperf: remove the comments that this is IPv4 only
IPv6 works (tested against iperf version 2.0.9 on linux)

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-22 06:39:04 +02:00
Simon Goldschmidt
b9b74b2d92 lwiperf: make tradeoff client mode work 2018-06-21 22:06:36 +02:00
Axel Lin
fb21bc1609 tcp_priv.h: LWIP_TCP_OPT_LENGTH: Enclosing macro argument in parentheses
Fix below build error:
In file included from
../../../../lwip/src/../test/unit/tcp/test_tcp.c:3:0:
../../../../lwip/src/../test/unit/tcp/test_tcp.c: In function
‘test_tcp_rto_timeout_syn_sent_impl’:
../../../../lwip/src/../test/unit/tcp/test_tcp.c:1246:113: error: suggest parentheses around arithmetic in operand of ‘|’ [-Werror=parentheses]
   const u16_t tcp_syn_opts_len = LWIP_TCP_OPT_LENGTH(TF_SEG_OPTS_MSS|TF_SEG_OPTS_WND_SCALE|TF_SEG_OPTS_SACK_PERM|TF_SEG_OPTS_TS);
                                                                                                                 ^
../../../../lwip/src/include/lwip/priv/tcp_priv.h:305:4: note: in definition of macro ‘LWIP_TCP_OPT_LENGTH’
   (flags & TF_SEG_OPTS_MSS       ? LWIP_TCP_OPT_LEN_MSS           : 0) + \
    ^~~~~

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-06-21 09:11:14 +08:00
Simon Goldschmidt
9992b48e90 fix compiling with LWIP_NOASSERT defined
See bug #54157
2018-06-20 20:56:20 +02:00
Simon Goldschmidt
824ebbe0e9 tcp: fix RTO timer not working if link is down
... and added some test cases for this situation
See bug #54139

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-19 22:48:06 +02:00
Simon Goldschmidt
3cdfc67dd8 ip4_frag: fix assertion on wrong pbuf
see bug #54117

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-19 21:29:16 +02:00
Simon Goldschmidt
7577e587be lwip_itoa: fix implicit conversion warning 2018-06-18 12:15:37 +02:00
Sylvain Rochet
ce16f8c498 PPP: remove unknown define references to PPP_NUM_TIMEOUTS when PPP_SUPPORT is disabled
Fail to build if PPP_SUPPORT is disabled because PPP_NUM_TIMEOUTS
references defines that are unknown if PPP_SUPPORT == 0. Move
PPP_NUM_TIMEOUTS to PPP_SUPPORT block and set a default value to 0
if PPP_NUM_TIMEOUTS is still not defined at the end of ppp_opts.h.

Fixes: e4e0fc4193 ("PPP: set PPP_NUM_TIMEOUTS_PER_PCB value to computed number of simultaneous timers")
Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2018-06-18 10:17:58 +02:00
Simon Goldschmidt
871f27628b lwiperf: fix unused function warning/error 2018-06-18 07:24:42 +02:00
Sylvain Rochet
e4e0fc4193 PPP: set PPP_NUM_TIMEOUTS_PER_PCB value to computed number of simultaneous timers
A deep analysis of simultaneously running timers showed we can use a
slightly smaller value for PPP_NUM_TIMEOUTS_PER_PCB, value which was
arbitrarily chosen to a safe value based on the number of enabled PPP
features. Add the boring and long analysis to the end of our internal
header file and use the result in ppp_opts.h.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2018-06-18 01:15:35 +02:00
Simon Goldschmidt
58b5a5fc5a lwiperf: implemented "dual" client mode 2018-06-17 21:04:57 +02:00
Simon Goldschmidt
a057caee45 lwiperf: start implementing iperf client
Only the transmission side works for now (todo: dual and tradeoff mode).
Also, only a 10 second timeout mode is implemented for now.

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-15 22:26:32 +02:00
Simon Goldschmidt
dbc16e6765 minor whitespace cleanup 2018-06-15 21:19:19 +02:00
Sylvain Rochet
f31160a6cb PPP, PPPoL2TP: properly ack receipt of duplicate packets
Managed to find the spirit behind the RFC. Looks like we need to send
a ZLB packet with counters as is to the packet (ZLB or not) we
previously sent to ack the message. Luckily we don't need more than
received NS/NR counters to forge the resent ack.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2018-06-15 17:29:50 +02:00
Sylvain Rochet
738a2fe846 PPP, PPPoL2TP: stop ICCN timeout when receiving ICCN ack
Remove spurious and hitless timeout function call once L2TP reach "data"
state.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2018-06-15 15:45:15 +02:00
Sylvain Rochet
5278202f66 PPP: remove now unnecessary null PPP IP4 output handler
netif_null_output_ip4 dummy handler appeared in netif core, remove our
own from PPP stack.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2018-06-15 14:41:19 +02:00
Sylvain Rochet
98008cb1ab PPP, PPPoL2TP: use expected peer NS instead of current peer NS
We never use the current peer NS value but always the next expected peer
NS value (current value plus one).

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2018-06-15 14:08:03 +02:00
Sylvain Rochet
a56519032e PPP, PPPoL2TP: drop unexpected packets from peer
Conform a little bit more to the RFC by dropping duplicate received
packets. It might help discover Ns sequence issues.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2018-06-15 14:02:58 +02:00
Sylvain Rochet
047c3c6528 PPP, PPPoL2TP: take care of Ns/Nr wraparounds
It can't be an issue since we only send and receive a few L2TP control
packets and we don't care about anything received next other than
sending Ack packet. For the sake of correctness properly handle Ns/Nr
counters wraparounds, it doesn't add more code anyway.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2018-06-15 01:33:07 +02:00
Sylvain Rochet
5b8760601b PPP, PPPoL2TP: wait for ICCN ack before starting PPP
L2TP tunnel is really UP only once we received the ICCN Ack packet,
generally with a ZLB packet. We actually drop all data packets until
we reach the "data" L2TP state, which is a sane thing to do, therefore
it makes no sense at all to start the PPP session a bit earlier.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2018-06-15 00:47:29 +02:00
Sylvain Rochet
b9fe13c105 PPP, PPPoL2TP: fix ZLB packets Ns value
Our Ns counter is the current slot rather than the next to ease packet
retransmission. Therefore we increment the Ns counter before using the
next slot instead of after. The RFC is written with post-increment in
mind rather than pre-increment, thus when the RFC says that Ns in not
incremented for ZLB packets it actually means that ZLB packets are sent
with the next Ns without post-incrementing the Ns value, meaning the
ZLB packet does not take a slot. Since we are using a pre-incremented
value for real slots we need to send ZLB packets with our current Ns
value plus one.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2018-06-14 23:42:29 +02:00
Sylvain Rochet
a48ff4aaf2 PPP, PPPoE: fix trivial build error
lwip/src/netif/ppp/pppoe.c: In function ‘pppoe_send_padt’:
lwip/src/netif/ppp/pppoe.c:1048:108: error: ‘sc’ undeclared (first use in this function)

sc is not passed to ‘pppoe_send_padt’ function because it might be
called to terminate unknown sessions.

Fixes: d4047ea1d1 ("Try to fix issues reported by coverity")
Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2018-06-14 19:58:41 +02:00
Axel Lin
a51c92b617 tcp_out: Fix trivial build error
Fixes: 6ac21515ca ("Add missing null checks")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-06-14 22:47:28 +08:00
Matthias Hofmann
6ac21515ca Add missing null checks.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-14 16:20:47 +02:00
Simon Goldschmidt
e61b925709 try to fix compiling with gcc & clang 2018-06-14 15:01:57 +02:00
Simon Goldschmidt
944f286d87 fix bug in RA MTU validation
Also fix that RA could change IPv4 MTU.
See bug #53696

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-14 12:55:18 +02:00
Simon Goldschmidt
39faa8f61d added tests for ip6addr_ntoa_r 2018-06-14 12:30:14 +02:00
Simon Goldschmidt
313664c59c ip6addr_ntoa_r: correctly generate ipv4 mapped addresses 2018-06-14 12:29:40 +02:00
Axel Lin
7c03f4cf46 Silence lwip_tolower compiler warning
Fix gcc build warning: array subscript has type 'char' [-Wchar-subscripts].

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-06-14 09:47:19 +08:00
Simon Goldschmidt
b0e5eeb7d2 udp: prefer correctly bound pcbs when receiving broadcast
See bug #53301

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-13 22:01:18 +02:00
Simon Goldschmidt
1bdc669b45 udp: restructure udp_input uncon_pcb selection in preparation for fixing bug #53301 2018-06-13 21:59:04 +02:00
Simon Goldschmidt
47ebb2b267 dns: add a comment about case insensitivity 2018-06-13 15:10:47 +02:00
Simon Goldschmidt
a9d6ea5953 introduce 'lwip_tolower' and use it in dns.c
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-13 15:08:11 +02:00
armink
66f7f06601 fix DNS resolution to not case insensitivity
See patch #9654

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-13 15:04:46 +02:00
Matthias Hofmann
8e23b8d903 Correct UDP rebind check.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-13 15:00:21 +02:00
Simon Goldschmidt
a75332a407 ip4_frag: correctly refragment packets that already have MF set
see patch #9645

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-13 14:56:18 +02:00
Simon Goldschmidt
25497bb387 bridgeif/slipif/zepif: check that input callback is not NULL 2018-06-13 10:53:50 +02:00
Simon Goldschmidt
38614e4f3e unit tests: remove dummy netif input function
This partly reverts a26a2e13 after removing that NULL check again.

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-13 10:46:44 +02:00
Axel Lin
61e3f49f69 netif: Don't return error if pass NULL netif_input_fn to netif_add
The new NULL checking against netif_input_fn make ppp stop working
because in ppp_new() it calls netif_add with NULL netif_input_fn.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-13 10:39:38 +02:00
Simon Goldschmidt
3f2227f04c Fix pppos after changing PBUF_POOL to PBUF_RAM
This partly reverts 31bc2f9b which broke pppos tx as 'pppos_output_append'
implements a custom scheme of checking available pbuf size.
Added a comment why PBUF_POOL is ok for tx in this special case.
See bug #51908

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-13 09:38:04 +02:00
Simon Goldschmidt
392c676ef5 fix bug #53273: IPv6 link-local address generation for non-ethernet type netif does not convert byte order 2018-06-13 08:57:17 +02:00
Simon Goldschmidt
0c5133d7cf fix ip6addr_aton for non-shortened ipv4 mapped addresses 2018-06-12 21:48:32 +02:00
Simon Goldschmidt
eb91fdd861 httpd: fix missing null termination when searching for a default file in file system folder 2018-06-12 20:14:04 +02:00