Commit Graph

6217 Commits

Author SHA1 Message Date
Axel Lin
9b638e7c05 apps/netbiosns: Convert to use lwip_isupper instead of open-coded
Also remove additonal (cname == '\0' || cname == '.') check because
it's covered by !lwip_isupper(cname) test.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-07-03 22:55:59 +08:00
Axel Lin
58be2b1573 Add define for lwip_isupper when LWIP_NO_CTYPE_H=0
lwip_isupper is not defined when LWIP_NO_CTYPE_H=0, add it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-07-03 22:55:07 +08:00
Dirk Ziegelmeier
e942818940 Filelists.cmake: Remove old documentation before generating new one to avoid orphaned files 2018-07-03 13:26:59 +02:00
Dirk Ziegelmeier
88ef663334 Add CMakeLists.txt to generate source distribution file 2018-07-03 12:54:17 +02:00
Simon Goldschmidt
fd0af07d2d tcp/udp bind: small code restructuring for IPv6-only
See bug #54229
2018-07-02 20:31:38 +02:00
Simon Goldschmidt
1e24f9c9cd dhcp: 2 small code improvements
See bugs #54226 and #54228
2018-07-02 20:27:12 +02:00
Simon Goldschmidt
19a929f5fb dhcp: fix parse error with chained pbfus
If a chained pbuf starts with DHCP_OPTION_PAD, an overflow check
triggers and the packet is ignored.

Fix this by changing the way the offset is increased for PAD.
Also ignore a packet that is missing the END option.

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-07-02 20:25:42 +02:00
Simon Goldschmidt
cc8995823a mdns: implement random time for initial probing 2018-06-28 22:10:45 +02:00
Simon Goldschmidt
af2cbad64a mdns: add 2 RFC constants 2018-06-28 22:07:23 +02:00
Simon Goldschmidt
8090afa4f9 mdns: minor coding style cleanup 2018-06-28 22:04:57 +02:00
Simon Goldschmidt
4506db4331 mdns: fix implicit cast warnings (size_t to u8_t) 2018-06-28 21:58:15 +02:00
Simon Goldschmidt
814341a6ed mdns: use an u8_t instead of an enum for mdns_hos::probing_state
This saves some bytes only, but it is actually more common in lwip code
2018-06-28 21:56:59 +02:00
Simon Goldschmidt
11e82e5355 UPGRADING: remove mdns_resp_announce() requirement after probing was added 2018-06-28 21:54:25 +02:00
Simon Goldschmidt
6067edfed3 mdns: add defines for mdns_name_result_cb_t result parameter 2018-06-28 21:52:58 +02:00
Jens Nielsen
9f1196fb53 MDNS send probes to verify domain before use
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-28 21:41:10 +02:00
Simon Goldschmidt
8223a8c73c docs: reference the nongnu archive, not nabble 2018-06-28 21:15:57 +02:00
Simon Goldschmidt
b1487e6480 ip4_reass: fixed duplicat NULL check
See bug #54197

Rerported-by: Andrey Vinogradov <andrey.vinogradov@teplomonitor.ru>
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-27 20:56:05 +02:00
Simon Goldschmidt
0610b34372 httpd: fixed duplicate NULL check
See bug #54196.

Reported-by: Andrey Vinogradov <andrey.vinogradov@teplomonitor.ru>
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-27 20:53:30 +02:00
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