Commit Graph

5853 Commits

Author SHA1 Message Date
Dirk Ziegelmeier
dd1ab2bf59 lwIP 2.2.0 development cycle start now 2018-09-30 09:02:15 +02:00
Simon Goldschmidt
e6a8415df3 Prepare 2.1.0 release
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-09-26 21:11:39 +02:00
Simon Goldschmidt
54a8112eb9 Documentation improvements for 2.1.0 (changelog, altcp) 2018-09-26 14:37:52 +02:00
Simon Goldschmidt
b9fc8cae68 Documentation improvements for 2.1.0 (mainly altcp/altcp_tls) 2018-09-24 22:44:32 +02:00
Simon Goldschmidt
a044c807f8 altcp_tls: rename altcp_tls_new -> altcp_tls_wrap, add altcp_tls_new
The new altcp_tls_new() is a type safe version of altcp_tls_alloc()

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-09-24 22:29:54 +02:00
Simon Goldschmidt
6229f9ef71 icmp_send_response: fix parameter order for LWIP_HOOK_IP4_ROUTE_SRC 2018-09-17 21:28:50 +02:00
Simon Goldschmidt
66838a70f3 more documentation preparations for v2.1.0 release 2018-09-17 21:16:58 +02:00
Simon Goldschmidt
0189e7b02f mqtt: allow user + pass longer than 255 chars
See bug #54655:
"MQTT brokers such as Google Cloud IoT Core requires MQTT clients
to send JSON Web Token (JWT) as password field of the MQTT Connect
packet. JWT can be more than 255 bytes.
Currently, the MQTT library restricts password to be less than 256
bytes, thus it prevents connectivity to Google Cloud IoT Core."

Fix that by just converting the local variables for these from u8_t
to u16_t.

Suggested-by: Richmond Umagat <richmond.umagat@brtchip.com>
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-09-13 14:59:08 +02:00
Dirk Ziegelmeier
796f98beb2 Fix no newline at end of http_client.c 2018-09-12 22:41:07 +02:00
Simon Goldschmidt
fc24d4139f altcp_tls_mbedtls: convert #error on too small TCP_WND to warning
Many TLS use cases are OK with a small TCP_WND, so don't prevent these
by having a preprocessor check that cannot be disabled.
2018-09-12 22:24:05 +02:00
Simon Goldschmidt
bbf80b05c8 ppp: fix implicit conversion from size_t to u8_t
Found when compiling with VS2017
2018-09-12 22:22:10 +02:00
Simon Goldschmidt
bc48eb512e Fix bug #54506 (LWIP_CHECKSUM_ON_COPY causes wrong checksum (0xFFFF))
one's complement sum was not correctly done, which could result in the
checksum being 0xFFFF instead of 0 in some cases.
2018-09-12 21:56:16 +02:00
Dirk Ziegelmeier
cdfa3dfa9d http_client.c: Fix compile when TCP is disabled 2018-09-12 08:27:43 +02:00
Dirk Ziegelmeier
be18fa98e4 Fix cleanup of existing documentation of target lwipdocs 2018-09-11 08:16:01 +02:00
Dirk Ziegelmeier
257dc1d6fd Fix doxygen warnings in altcp_proxyconnect.c 2018-09-10 13:30:50 +02:00
Dirk Ziegelmeier
236d6df495 Fix lwipdocs target in Filelists.cmake
EXCLUDE_FROM_ALL is not supported at add_custom_target()
2018-09-10 13:28:01 +02:00
Simon Goldschmidt
93b2074f2b Remove LWIP_DHCP_CHECK_LINK_UP define as it's useless
See bug #54574

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-09-07 21:01:32 +02:00
Simon Goldschmidt
7749088a83 Fix 2way-auth connections for TLS clients
TLS clients that need 2-way authentication (e.g. Amazon AWS IoT cloud mqtt)
need to pass a certificate and private key when creating the tls altcp_pcb.

Added a new function altcp_tls_create_config_client_2wayauth() for this that
replaces altcp_tls_create_config_client() for such clients.

See bug #54601.
2018-09-07 20:59:31 +02:00
Dirk Ziegelmeier
24fc93e12f Remove checks that the SO_* socket options and SOF_* lwIP-internal flags match
not needed any more since commit b0344518e8
"sockets.c: Don't rely on #defines in socket.h to be in sync with ip.h
Map SO_* to SOF_* #defines"

Reported by Joan Lledó on mailinglist 6.Sep.2018
2018-09-07 10:01:59 +02:00
Martine Lenders
264b89764d Make zepif dependent on LWIP_UDP config
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-09-04 22:10:53 +02:00
Sylvain Rochet
fa3826a1d3 PPP: improve randomization of LCP magic number after power-up
magic_init() is first time called from ppp_init(), which is called from
lwip_init(). If system has no RTC, sys_jiffies() returns same value in
this moment after every power-up or system reset. This value used in LCP
magic number generation after ppp_connect(), which leads to same magic
number after every restart. Subsequent magic_randomize() calls takes
place in ppp_input(), after magic number generation.

Call magic_randomize() somewhere near start of ppp_connect() (and
ppp_listen()) as it might be called later at a random time.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2018-08-31 10:12:50 +02:00
Dirk Ziegelmeier
dac4cb05f7 Fix bug #54569: Compiler warning in ip4.c: unused parameter dest 2018-08-29 08:55:25 +02:00
Axel Lin
7b7bc349ae netif/lowpan6_ble: Fix comment for parameter order of ble_addr_to_eui64
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-08-19 22:47:43 +08:00
Axel Lin
bcd6c8a2d3 apps/sntp: Fix parameter name in doxygen comments
Make the parameter name in doxygen comments consistent wit the code.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-08-19 21:41:47 +08:00
Simon Goldschmidt
0674aa60fe sntp_getservername: fix parameter name in doxygen comments
Reported-by: Gisle Vanem <gisle.vanem@gmail.com>
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-08-18 20:23:24 +02:00
Dirk Ziegelmeier
e351937ea4 More cmake build system cleanups 2018-08-09 09:50:29 +02:00
Simon Goldschmidt
e8683ea9df api_lib: fix NETCONN_MBOX_WAITING_DEC() for LWIP_NETCONN_FULLDUPLEX
This was a copy & paste bug from ...INC()
2018-08-07 13:39:41 +02:00
Simon Goldschmidt
6363edc1db mqtt: fix reference function name in comment 2018-08-07 13:38:39 +02:00
Dirk Ziegelmeier
a19ea8b8d6 Cleanup CMAKE build system
Use target-specific commands for compile flags only
2018-08-06 13:05:35 +02:00
Dirk Ziegelmeier
aafc0adfe1 Fix bug #54381: SNMP RAW_DATA support is broken 2018-07-26 14:16:00 +02:00
Simon Goldschmidt
258cab1b22 fix bug #54315 (IPV6_V6ONLY socket accepts IPV4 connections)
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-07-23 21:47:33 +02:00
Simon Goldschmidt
c3d8b1ca80 add 'extern "C" {}' for cplusplus in ppp headers 2018-07-23 20:04:56 +02:00
Simon Goldschmidt
b5b31d86b2 fix dependencies in lwip/prot/dhcp.h and lwip/prot/igmp.h 2018-07-23 17:33:28 +02:00
Simon Goldschmidt
5bef7ea72f add 'extern "C" {}' for cplusplus in many headers 2018-07-19 22:05:43 +02:00
Simon Goldschmidt
633205ba78 fix bug #54254 (ppp/utils.c: use lwip_isdigit()) 2018-07-19 21:48:04 +02:00
Dirk Ziegelmeier
eeb2218b3d Revert "Test / RFC: Reformat a few files using clang-format"
This reverts commit 8b4a8159a8.

We do not want to do this shortly before a release. Reformatting (buggy reformatting) may introduce new bugs.
2018-07-18 08:34:01 +02:00
Dirk Ziegelmeier
0985e925a1 Fix bug #54327: V2.1.0rc1 pbuf.c misses stdint.h include
... without reformatting the document (clang-format)
2018-07-18 07:31:47 +02:00
Dirk Ziegelmeier
cffb5cc087 Revert "Fix bug #54327: V2.1.0rc1 pbuf.c misses stdint.h include"
This reverts commit 4e74421dac.
2018-07-18 07:30:41 +02:00
Dirk Ziegelmeier
8b4a8159a8 Test / RFC: Reformat a few files using clang-format
Does it compile? Does it look good (enough)?
2018-07-17 21:15:48 +02:00
Dirk Ziegelmeier
4e74421dac Fix bug #54327: V2.1.0rc1 pbuf.c misses stdint.h include 2018-07-17 20:45:09 +02:00
Simon Goldschmidt
07dd2aec23 Prepare v2.1.0.rc1
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-07-12 21:18:17 +02:00
Simon Goldschmidt
cf330c50e6 cmake: add .rcX or .dev suffix to LWIP_VERSION_STRING 2018-07-12 21:16:59 +02:00
Axel Lin
d3191e4835 dhcp6: Trivial comment typo fixes
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-07-12 21:35:38 +08:00
Axel Lin
29364d2a50 sockets: Make socket_ipv4/ipv6_multicast_memberships array static
They are only referenced in sockets.c, thus make them static.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-07-12 21:34:01 +08:00
Jasper Verschueren
d65681a7d7 DHCP request send on reboot does not contain hostname option
When the network is changed, dhcp is rebooted.
It will send a dhcp request again to verify it's lease.

DHCP requests are send out in selecting state, rebinding, renewing
and rebooting. But in the rebooting state the hostname option is
not included. This means that after reboot, the hostname will be
unknown to the DNS.

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-07-11 19:55:49 +02:00
Simon Goldschmidt
7b8a784c4f fix 2 small bugs found by coverity 2018-07-11 10:57:57 +02:00
Axel Lin
d73efd7d38 dhcp: Prevent NULL pointer dereference in dhcp_select
Move the code to make sure netif is not NULL before calling
netif_dhcp_data(netif).

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-07-05 21:39:00 +08:00
Simon Goldschmidt
596f742066 etharp: fix using ARP_TABLE_SIZE >= 0x80 2018-07-05 09:13:28 +02:00
Joel Cunningham
2bd1e313b9 etharp: cast netif_addr_idx_t to u16_t to match format type
This fixes an issue seen on MacOS with Clang 9.0.0:

../../../../lwip/src/core/ipv4/etharp.c:1069:142: error: format specifies type 'unsigned short' but the argument has type 'netif_addr_idx_t'
      (aka 'unsigned char') [-Werror,-Wformat]
        LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: dropped previously queued packet %p for ARP entry %"U16_F"\n", (void *)q, i));
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~

../../../../lwip/src/core/ipv4/etharp.c:1074:120: error: format specifies type 'unsigned short' but the argument has type 'netif_addr_idx_t'
      (aka 'unsigned char') [-Werror,-Wformat]
      LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: queued packet %p on ARP entry %"U16_F"\n", (void *)q, i));
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~

By default, netif_addr_idx_t is u8_t, so cast up to u16_t to match the format type
2018-07-04 16:11:46 -05:00
Simon Goldschmidt
341623c8be opt.h: more indent fixes, remove unnecessary brackets 2018-07-04 15:07:28 +02:00
Simon Goldschmidt
dccdbdd309 opt.h: fix indents 2018-07-04 14:57:54 +02:00
Axel Lin
82fc0e8937 apps/netbiosns: Make *netbiosns_pcb static
It's only referenced by netbiosns.c, thus make it static.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-07-04 16:51:18 +08:00
Simon Goldschmidt
2d65251c6c mdns: add config option to use netif ext callback
e.g. if the calling stack should not invoke the mdns functions due
to high stack usage, disable the option and trigger it yourself.

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-07-03 21:09:33 +02:00
Simon Goldschmidt
b398a2a394 fix implicit cast warnings in IAR and others
See bug #54190

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-07-03 20:53:32 +02:00
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
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
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
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
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
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
Simon Goldschmidt
1bf323e12f remove 2 NULL checks which are wrong 2018-06-12 13:46:44 +02:00
Simon Goldschmidt
e7c0619189 fix NULL checks (compiler error, tcp_rst allows pcb==NULL) 2018-06-12 13:32:12 +02:00
Simon Goldschmidt
31bc2f9b20 fixed bug #51908: PPPOS uses PBUF_POOL in transmit pathway
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-12 10:39:46 +02:00
Matthias Hofmann
342d0eadfb Add null pointer checks for TCP, UDP and netif
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-12 10:24:08 +02:00
Simon Goldschmidt
6ea2483546 ip4_canforward(): don't route multicast packets
Added LWIP_HOOK_IP4_CANFORWARD to still implement multicast routing.
See bug #52914

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-12 06:45:30 +02:00
Axel Lin
1fd145fbc9 Fix trivial copy-n-paste mistake in ip4_debug_print
Fixes: 288d3c2802 ("fixed bug #54006: Two compiler warnings on IAR when debug is enabled")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-06-12 11:36:05 +08:00
Simon Goldschmidt
2837bb310c fix ip6addr_aton handling IPv4-mapped addresses
... and added a unit test for it

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-11 22:21:31 +02:00
Simon Goldschmidt
288d3c2802 fixed bug #54006: Two compiler warnings on IAR when debug is enabled 2018-06-11 20:11:47 +02:00
Simon Goldschmidt
31e07f90bd send router solicitations every 4 seconds
See bug #53973

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-08 23:09:13 +02:00
Simon Goldschmidt
4fa33c17bc add reference to the RFC for the last commit... 2018-06-08 22:54:02 +02:00
Simon Goldschmidt
1a294622d0 ipv6 router solicitation: "ensure at least one solicitation is sent"
Fix the case where nd6_send_rs() fails: send one solicitation here,
not LWIP_ND6_MAX_MULTICAST_SOLICIT.

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-08 22:45:55 +02:00
Simon Goldschmidt
fd050b8a97 fix bug #53971 Lwip sends Router Solicitation on address changes
... and add a unit test for it.

Moved resetting netif->rs_count from all reports to link-up and netif-up only.
While at it, clean up the interface a bit so that netif->rs_count is touched
from nd6.c only.

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-08 22:18:50 +02:00
Simon Goldschmidt
b1ffb3a8d3 Try to fix bug #53952 (ip4_addr_debug_print_val unaligned structure reference compiler warning) 2018-05-24 23:13:27 +02:00
Dirk Ziegelmeier
d996d0f486 Apply patch #9629: tftp_cleanup() should clean up more
By Jens Nielsen
2018-05-21 09:27:31 +02:00
Simon Goldschmidt
11c294e973 fix type conversion errors introduced with last commit 2018-05-17 22:35:12 +02:00
Simon Goldschmidt
0c2fdfcf42 Fix bug #53667: ARP table max size is to small
arp table functions, nd6 destination cache and struct netif_hint
can now be u16_t or u8_t depending on table size, so up to 32K
entries can be used in these tables (s16_t)

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-05-17 21:52:01 +02:00
Simon Goldschmidt
0f165ff136 etharp: use generic types in external access to ARP table
This should hide the internal type used for access to the ARP table
which currently is s8_t or u8_t, depending on the use case.

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-05-17 21:16:06 +02:00
goldsimon
8f3df7c862 tcp: fix const warning for LWIP_NETIF_HWADDRHINT==1 2018-05-17 20:57:02 +02:00
Axel Lin
ec8c764fcb apps/smtp: Fix build warning when !(SMTP_SUPPORT_AUTH_PLAIN || SMTP_SUPPORT_AUTH_LOGIN)
Fix build warning: ‘smtp_base64_encode’ declared ‘static’ but never defined.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-05-17 19:50:17 +08:00
Axel Lin
795f05c5d3 apps/smtp: Fix build warning when SMTP_CHECK_DATA==0
Fix build warning: 'smtp_verify' declared 'static' but never defined.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-05-17 17:06:31 +08:00
Joel Cunningham
ffaee59f3e loopif: only schedule poll when first packet is enqueued
This optimizes the netif_loop_output to only schedule a call to poll when
the first packet is enqueued. This ensures netif_poll is ran once per
burst of packets that are sent (which is typical in a TCP transfer)

The old behavior scheduled a call to poll for every packet that was
enqueued and this lead to exhaustion of the MEMP_TCPIP_MSG_API memory pool
and tcpip_mbox (if port is using static mbox size). The extra callbacks are
wasted work because netif_poll drains the entire queue when ran

This issue presented itself when large TCP transfer go across the loopback
netif
2018-05-02 09:16:01 -05:00
Joel Cunningham
070e449690 loopif: disable checksums
This disable checksum generation and checking for the loopback netif
when LWIP_CHECKSUM_CTRL_PER_NETIF is enabled

Checksums are not needed for the loopback adapter and this will increase
performance for loopback communication
2018-05-02 09:16:01 -05:00
goldsimon
a445172661 makefsdata: fix hiding local variable 'i' 2018-05-02 10:05:24 +02:00
Dirk Ziegelmeier
059bc952f6 Revert Filelists.mk to original state - it is not really useful to generate it from Filelists.cmake 2018-05-02 09:40:36 +02:00
Dirk Ziegelmeier
f116bc37d1 Cleanups in CMake files 2018-04-30 22:29:07 +02:00
Dirk Ziegelmeier
9672b4c3af Work on CMake build system - restructure to use included cmake files, this is more flexible 2018-04-30 21:35:12 +02:00
Dirk Ziegelmeier
d40c3251d7 Work on CMake build system
Always configure files, doesn't hurt and makes CMakeLists.txt more readable
2018-04-26 23:31:31 +02:00
Dirk Ziegelmeier
ad8e08a08b Continue workin on CMake build system
Split lwip lib into lwIP core and lwIP apps
Compile makefsdata only when NOT cross-compiling
2018-04-26 22:33:53 +02:00
Dirk Ziegelmeier
c61a0570b1 Work on CMake build system 2018-04-25 22:44:30 +02:00
goldsimon
2291f9a8fa tftp: decrease TFTP_TIMER_MSECS
This timeout is used to measure TFTP_TIMEOUT_MSECS fine enough.
Calling tftp_tmr at a 50ms interval to handle a 1 seconds timeout
produces way too much cpu load (and prevents sleep).

Signed-off-by: goldsimon <goldsimon@gmx.de>
2018-04-25 21:27:58 +02:00
goldsimon
e05a96550f etharp: fix bogus ifdef regions
(after separating etharp and ethernet)
2018-04-25 21:17:47 +02:00
goldsimon
b2ef9d9046 netbiosns: fix bug #53747 (need to verify received packet length) 2018-04-25 20:56:34 +02:00