It turns out the crash only occurs if LWIP_DEBUG is enabled. If the
parameter dest is NULL the function tries to find a route using the
destination address of the packet instead. If this fails as well a
debug message is printed but it is still using dest causing a NULL
pointer dereference and crash at src/core/ipv6/ip6.c line 1312.
[erik@kryo.se: Apply fix to ip6_output_hinted as well]
This patch adds a few entries in .gitattributes to specify files that
should never end up in a distribution tarball.
Signed-off-by: Hu Keping <hukeping@huawei.com>
This simple patch causes tcp_listen() to inherit the netbuf_idx setting
of the original pcb. Without this, it is not possible to restrict a
socket to a specific interface using SO_BINDTODEVICE before listening.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
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);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../src/../test/unit/ip4/test_ip4.c: In function ‘test_ip4_icmp_replylen_short’:
../../../../src/../test/unit/ip4/test_ip4.c:291:35: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
fail_unless(linkoutput_byte_ctr == icmp_len + sizeof(unknown_proto));
Plus minor cleanup in second icmp reply test
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.
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.
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);
^