Commit Graph

131 Commits

Author SHA1 Message Date
Simon Goldschmidt
f7fe057821 win32 pcapif: fix "heap-use-after-free" on shutdown 2023-09-27 21:28:29 +02:00
Maxim Uvarov
4e6dd9c576 ping: add stop function
ping in raw mode does some set up and sets timeout, but clean
up procedure is missing. That is needed for case if PING_RESULT() macro
is used for application exit.

Also implement stop functionality when using sockets.
Running ping is stopped when calling ping_init() again.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2023-09-27 20:56:46 +02:00
Simon Goldschmidt
2a3711a566 win32: check: adjust check config.h to run with newest check library on VS2022
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2023-06-29 22:14:36 +02:00
Simon Goldschmidt
1a5dffb931 win32: pcapif: ensure we can run with npcap as well
By default, npcap keeps its DLLs not in system32 but in system32/npcap.
To load DLLs from there, mark them as "delay load DLLs" and adjust the
DLL search path before using/loading them.

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2023-06-29 22:11:55 +02:00
Simon Goldschmidt
bfcbf80221 win32: msvc: fix msvc project files to compile with VS2022; add test_tcp_state
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2023-06-29 22:08:45 +02:00
Shawn Silverman
f84076b112 Add missing terminating newlines to LWIP_DEBUGF statements 2023-05-11 22:13:51 +02:00
Simon Goldschmidt
90c9a482a6 ci: fix compiling test_tcp_state.c; add to msvc project 2023-05-11 20:26:21 +02:00
David Cermak
187e4ededd contrib/addons: Add example of using DHCP extra options hooks 2023-05-10 22:16:57 +02:00
David Cermak
a6874a46c6 contrib/ports: Add semaphore per thread option for unix 2023-05-10 21:49:34 +02:00
Simon Goldschmidt
59ec032fa9 pppos: add new pppos unit test to vsproj 2023-05-10 20:59:36 +02:00
Renzo Davoli
0f2de1f684 contrib/ports/unix: add vdeif 2023-04-07 22:13:55 +02:00
Renzo Davoli
427b4f9b08 add posixlib 2023-04-07 22:11:27 +02:00
Renzo Davoli
6a350a0278 contrib/port/unix/lib: exclude slipif.c source 2023-04-07 22:07:17 +02:00
Simon Goldschmidt
3fe8d2fc43 get cmake to compile under windows with ms cl compiler
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2023-01-03 21:34:05 +01:00
Simon Goldschmidt
e6341a6081 some documentation fixes after merging contrib and example apps
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2022-12-22 21:42:42 +01:00
Steven Wartik
4b7a54c06c Added warning to cmake instructions when lwipcfg.h isn't present.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2022-12-22 20:42:25 +01:00
Giuseppe Modugno
52b4649636 Replace C++ comment with standard C comment to avoid error during building with -Werror. 2022-05-09 21:07:14 +02:00
Simon Goldschmidt
7807402899 cmake: fix building on windows with mingw64
- wpcap/packet libraries were wrong (.a, not .lib; not the x64 ones)
- link order resulted in undefined references

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2022-03-22 22:38:28 +01:00
Simon Goldschmidt
215dec653b fix some compile problems with mingw 2022-02-12 09:40:32 +01:00
Florian La Roche
34e435c786 tapif: fix strncpy
Adjust the strncpy() call in tapif.c to how this is coded
in other strncpy() invocations. Also gcc warns about this.

See patch #10142
2021-12-30 22:58:52 +01:00
Florian La Roche
62ac0faad8 redefine many vars as "static"
See patch #10156
2021-12-30 22:13:01 +01:00
Erik Ekman
853258fff0 Switch from travis to github actions for CI
travis.org is no longer active
2021-11-27 20:48:02 +01:00
Florian La Roche
089697bb1c Use NULL instead of 0 as a pointer
Recommended by 'sparse' tool
2021-11-27 15:49:20 +01:00
Erik Ekman
f3300731be example_app: Minor tweaks
- Make variables static
- Fix spelling
- Use NULL instead of 0 as a pointer
2021-11-26 22:41:06 +01:00
quanjia
553fedd443 ping: sizeof to struct not pointer 2021-11-25 00:14:59 +01:00
Florian La Roche
3636b3e2d1 iteropts.sh: Fix warning on first run
Running iteropts.sh there is a warning on the first
cycle that lwipopts_test.h cannot be removed.
2021-11-24 23:04:57 +01:00
Florian La Roche
fdcfb9bdce contrib/ports: check library has moved to github 2021-11-24 22:52:18 +01:00
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