Commit Graph

104 Commits

Author SHA1 Message Date
Florian La Roche
e8741da9d2 contrib/ports: Remove redundant -Wredundant-decls 2021-10-03 12:45:51 +02:00
Simon Goldschmidt
bb5ee3783a fix compiling/running tests on win32
- new files
- different warning settings
- all tests run in a single process (no fork)
2021-05-21 22:00:49 +02:00
Simon Goldschmidt
12b45506dd fs_example: fix comment in fs_wait_read_custom
See bug #59866
2021-01-30 22:13:29 +01:00
Mike Kleshov
9b040624c0 httpd: follow-up to previous commit
see bug #59876
2021-01-28 19:53:57 +03:00
Jacob Berg Potter
f7ff2d416c ports/freertos: add missing include of tcpip.h
To fix build (lock_tcpip_core is not defined otherwise)
2021-01-23 13:41:34 +01:00
Erik Ekman
ecab77654a ports/unix/check: Ignore error from fail_* macros
Usage of fail_if/fail_unless macros with a message results in a
warning with the latest version of check (0.15.2+) and GCC.

Ignore this specific error (since warnings are treated as errors) for now.

Example failure:

In file included from ../../../../src/../test/unit/lwip_check.h:7,
                 from ../../../../src/../test/unit/lwip_unittests.c:1:
../../../../src/../test/unit/lwip_unittests.c: In function ‘lwip_check_ensure_no_alloc’:
../../../../src/../test/unit/lwip_unittests.c:55:7: error: too many arguments for format [-Werror=format-extra-args]
   55 |       "mem heap still has %d bytes allocated", lwip_stats.mem.used);
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-01-13 21:48:03 +01:00
Erik Ekman
45332ab38c ports/unix/check: Fix 'make dep'
It used to fail with this error after building the depfiles:

clang -DLWIP_NOASSERT_ON_ERROR -I/usr/include/check -I../../../../src/../test/unit -Wno-gnu-zero-variadic-macro-arguments -g -DLWIP_DEBUG -Wall -pedantic -Werror -Wparentheses -Wsequence-point -Wswitch-default -Wextra -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wc++-compat -Wwrite-strings -Wold-style-definition -Wcast-align -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Wunreachable-code -Wuninitialized -Wmissing-prototypes -Wredundant-decls -Waggregate-return -Wlogical-not-parentheses -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -Wdocumentation -Wno-documentation-deprecated-sync -I. -I../../.. -I../../../../src/include -I../../../ports/unix/port/include -c
clang-11: error: no input files

Also don't include depfiles while cleaning, to avoid generating them
just to remove them.
2020-12-03 21:55:45 +01:00
Erik Ekman
63fb3721ef ports/unix/check: Split depfiles for faster build
Having just one depfile (.depend) means it has to be fully regenerated
on every change, and it can't be done in parallel.

After this change the rebuild time after touching a single test file has
gone from 5.0 to 0.9 seconds. (make -j12)

Build of tests from clean has gone from 8.1 to 5.5s.

We could go even further and have one depfile per c-file, but this felt
like a simple first step giving a nice improvement.
2020-12-03 21:41:31 +01:00
Erik Ekman
c748395bda PPP: Change data argument in sio_write to const
To fix the build after ppp_output_cb started taking it as const in
commit b2d1fc119d.

Fixes this failure:
../contrib/examples/ppp/pppos_example.c: In function ‘ppp_output_cb’:
../contrib/examples/ppp/pppos_example.c:163:29: error: cast discards ‘const’ qualifier from pointer target type [-Werror=cast-qual]
   return sio_write(ppp_sio, (u8_t*)data, len);
                             ^
2020-12-03 09:47:00 +01:00
Freddie Chopin
b2d1fc119d PPP, PPPoS: Use const void* instead of u8_t* in pppos_output_cb_fn()
There is no good reason why this function should take a non-const
pointer, as the output callback should never modify what lwIP gives it.
While changing that also switch to a more generic `void*` instead of
"byte".
2020-10-20 05:38:03 +02:00
Freddie Chopin
7f91a71eca Contrib, PPP: Remove trailing whitespaces in pppos_example.c 2020-10-20 05:30:59 +02:00
Sylvain Rochet
bedb4e4745 PPP: disable VJ support by default
VJ support is known to be broken when built with some compiler
optimizations enabled, disabling it by default until someone needs it
and fixes it.

It was mostly used with dial-up modems, it is useless with PPPoE and
PPPoL2TP and is probably useless as well with cellular modems, so
disabling it by default makes sense anyway.
2020-10-17 01:19:35 +02:00
Erik Ekman
264a5a3e97 Rename IP and Ethernet equality checkers from _cmp to _eq
Functions ending in cmp are expected to return 0 on equality but these
return non-zero.

eth_addr_cmp -> eth_addr_eq

ip_addr_cmp -> ip_addr_eq
ip4_addr_cmp -> ip4_addr_eq
ip6_addr_cmp -> ip6_addr_eq

ip_addr_netcmp -> ip_addr_net_eq
ip4_addr_netcmp -> ip4_addr_net_eq
ip6_addr_netcmp -> ip6_addr_net_eq

ip_addr_cmp_zoneless -> ip_addr_zoneless_eq
ip6_addr_cmp_zoneless -> ip6_addr_zoneless_eq

ip6_addr_cmp_zone -> ip6_addr_zone_eq
ip6_addr_netcmp_zoneless -> ip6_addr_net_zoneless_eq
ip6_addr_nethostcmp -> ip6_addr_nethost_eq
ip6_addr_cmp_packed -> ip6_addr_packed_eq
ip6_addr_cmp_solicitednode -> ip6_addr_solicitednode_eq

All call sites have been changed, and fallback macros have been added to not
break external users.
2020-07-07 18:51:45 +02:00
Erik Ekman
776e612872 Remove extra newlines in LWIP_ASSERT messages 2020-07-01 20:52:12 +02:00
Simon Goldschmidt
fc85b055d7 sys: add the possibility to fuzz what sys_now() returns 2020-02-17 21:39:46 +01:00
Simon Goldschmidt
9b5a6fe1dc win32 port: fix LWIP_RAND() being called without sys_init()
This can happen in tests...
2020-02-17 21:28:04 +01:00
Simon Goldschmidt
04cf6bbe66 pcapif: add option PCAPIF_RX_READONLY to simulate readonly RX
This uses VirtualAlloc/VirtualProtect on windows to simulate RX buffers
that are readonly to lwIP (see task #14807).

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2020-02-16 20:43:33 +01:00
Simon Goldschmidt
1ffcc5079c Fix-more-typos-using-codespell
Committing nearly all changes done by 'codespell_check.sh -w'

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2020-02-15 21:45:53 +01:00
jona
d6a6b661d9 Fix typos using codespell
Conservative strategy was used, maybe other typos remain.

Rebased: Simon Goldschmidt <goldsimon@gmx.de>
2020-02-15 21:45:41 +01:00
Simon Goldschmidt
5e52d1a4b1 win32: fix 2 compiler warning nits in win32 port
Reported-by: Gisle Vanem <gisle.vanem@gmail.com>
2020-02-10 21:55:32 +01:00
Simon Goldschmidt
4f30e0daff httpd: post example: fix typo in last version
See bug #57742

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2020-02-04 22:25:04 +01:00
Gao Qingshui
a9ac18aebb ip6: enable ip6_autoconfig_enabled by default
See bug #56135

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2020-02-04 22:23:58 +01:00
Simon Goldschmidt
3034e9fad0 httpd: post example: free pbuf in httpd_post_receive_data
See bug #57742

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2020-02-04 22:12:14 +01:00
Simon Goldschmidt
4c15191b1d snmp: update documentation 2020-02-03 20:35:22 +01:00
Simon Goldschmidt
f857260e29 fix compiling fuzz test under Linux after merging contrib to main repo 2019-12-11 22:20:14 +01:00
David Girault
aa79b90d3c mdns: update probe conflict function to provide service in conflict
- Send service slot index to the mdns result function. In case of conflict, the user
  will have to remove the service or rename it.
- Break after hostname conflict in order to managed it first, and managed service name
  conflict after.
- Provide a function to get the TXT userdata for a service (allowing app to match with
  its own data).

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2019-12-11 20:11:13 +01:00
Simon Goldschmidt
e0be5a7f6d default_netif.c: add missing include
For sys_msleep(), we need to include sys.h
2019-12-11 19:49:26 +01:00
Joan Lledó
2b6d9a56f7 Contrib: Add kFreeBSD to the Unix port
* cc.h:
  * Identify kFreeBSD by macros
  * Use standard error codes for this OS

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2019-12-10 21:55:22 +01:00
Joan Lledó
0aad45593f Unix port: sio module: memset struct sigaction to 0
* Use memset to set all struct sigaction fields to 0
  instead of doing it field by field, since fields
  depend on the architecture.
2019-08-16 10:57:35 +02:00
Simon Goldschmidt
c4f33be3f3 fix compiling last commit (save before committing...) 2019-08-06 22:34:17 +02:00
Simon Goldschmidt
19e22f870f add https example 2019-08-06 22:17:55 +02:00
Joan Lledó
2f5305c259 Unix port: improve support for the Hurd
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2019-08-01 21:10:36 +02:00
Joan Lledó
fa6f8054eb Move LWIP_MARK_TCPIP_THREAD to include/lwip/sys.h
* LWIP_MARK_TCPIP_THREAD moved to include/lwip/sys.h
* Unix port macro definitions moved to sys_arch.h
  * LWIP_MARK_TCPIP_THREAD
  * LOCK_TCPIP_CORE
  * UNLOCK_TCPIP_CORE

(goldsimon@gmx.de: fixed unix Makefile build and win32 build)
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2019-07-26 20:09:40 +02:00
Dirk Ziegelmeier
bda6909df8 Fix bug #56003: -Wc++-compat causes build failure when using mbedtls
Build without -Wc++-compat when MBEDTLS is included in project
Works around problem in MBEDTLS headers
2019-03-26 20:11:37 +01:00
Dirk Ziegelmeier
a329bdd607 Fix bug #55964: CMake's LWIP_COMPILER_FLAGS should be split for C and C++
CMakeCommon.cmake: Use conditional for flags that only make sense for C code
2019-03-20 11:20:35 +01:00
Dirk Ziegelmeier
a7b06bef5f Fix iteropts.sh to correctly return error code 2019-02-03 09:31:26 +01:00
Dirk Ziegelmeier
32bc761245 iteropts.sh: -j 4 is sufficient 2019-02-03 09:09:50 +01:00
Dirk Ziegelmeier
71f56714dd Remove iteropts test errors again, still not working 2019-02-02 23:17:39 +01:00
Dirk Ziegelmeier
95dbe78821 Add bug to iteropts test to check if travis fails now 2019-02-02 23:10:31 +01:00
Dirk Ziegelmeier
c03e949ca9 Try to fix iteropts build, try to make travis fail when iteropts test fails 2019-02-02 23:04:52 +01:00
Dirk Ziegelmeier
3f4e183e3f Disable documentation warning in iteropts test
Fails because some functions have different parameter lists depending on lwIP options (e.g. netif_add())
2019-02-02 22:59:54 +01:00
Dirk Ziegelmeier
78a0a62484 Add missing newline at end of file 2019-02-02 22:58:53 +01:00
Dirk Ziegelmeier
dc607c5be4 Fix lwip_port_rand()
(Didn't stash again after last change)
2019-02-02 22:38:49 +01:00
Dirk Ziegelmeier
aa4668cc47 Add lwip_port_rand() to unix port 2019-02-02 22:37:18 +01:00
Simon Goldschmidt
cbc80a0920 revert accidentally committed files 2019-01-30 21:14:01 +01:00
Simon Goldschmidt
5666f305ce sntp: obey KoD when using multiple servers
See bug #55253 (SNTP retry next server instantly result as a flood of NTP request).
Added 'sntp_getkodreceived()' to check the status.
2019-01-30 20:42:56 +01:00
Simon Goldschmidt
8e86555f93 mdns: fix compiler errors and coding style 2019-01-30 20:15:26 +01:00
Simon Goldschmidt
2037ec371c test: fix compiling unit test on win32 2019-01-30 14:53:41 +01:00
Simon Goldschmidt
3e59b224fa tcpecho_raw: fix bogus pbuf_free on error 2019-01-30 14:20:16 +01:00
Dirk Ziegelmeier
ea14b774c8 Replace several occurences of stdint types by lwIPs portability typedefs
Fixes bug #55405: Usage of uint8_t instead of ui8_t in TCP code
2019-01-06 21:19:04 +01:00