Commit Graph

6686 Commits

Author SHA1 Message Date
Axel Lin
919dc2019a acd: Fix updating prev pointer in acd_remove
Fixes: 3a788b6e8b ("dhcp: remove acd handle when stopping dhcp")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2021-05-14 13:48:43 +08:00
Eric Koldeweij
b538bff383 ip6: Fix crash in ip6_output with debug enabled
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]
2021-05-13 13:40:33 +02:00
Erik Ekman
b9056e148e acd: Fix LWIP_ASSERT argument order 2021-05-13 13:28:02 +02:00
Simon Goldschmidt
3a788b6e8b dhcp: remove acd handle when stopping dhcp
see bug #57706
2021-05-12 21:05:17 +02:00
Simon Goldschmidt
fa5ca55c9d pbuf_realloc: check that mem_trim does not move the memory
Our own implementation does not do this, but overridden implementations
calling 'realloc()' might invalidly do this
2021-05-12 21:05:17 +02:00
Erik Ekman
b0e347158d dhcp: Add missing newline to debug message 2021-03-25 20:56:21 +01:00
Simon Goldschmidt
0056522cc9 netdb: improve documentation of LWIP_DNS_API_HOSTENT_STORAGE 2021-03-05 13:04:59 +01:00
Simon Goldschmidt
8a900aa81f netdb: fix alignment warning in debug output
see bug #58650
2021-03-05 13:04:18 +01:00
Simon Goldschmidt
3ff267fbed dhcp: prevent dhcp_cleanup passing external data to heap 2021-03-04 22:20:17 +01:00
Simon Goldschmidt
c7e1b35899 dhcp: convert 'subnet_mask_given' to 'flags'
Don't waste 7 bits (in preparation for more flags)
2021-03-04 22:16:19 +01:00
Simon Goldschmidt
18b1178e0c makefsdata: add version info
This is required to make it possible to see you're using an old version if something doesn't work...
See task #15331
2021-03-04 21:51:06 +01:00
Simon Goldschmidt
f924c43621 doc: add description to get a release tgz from git 2021-03-04 21:46:58 +01:00
Harrold Spier
79c8a04152 SNMP netconn API should not check for core locked
See patch #9907
2021-03-04 21:29:20 +01:00
Hu Keping
ccea55370a Remove unnecessary files in release tarball
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>
2021-03-04 21:22:20 +01:00
Jeremy HU
4a169109a7 makefsdata: Fix flags missing
Fix the Perl script from which the generated fsdata.c cause runtime assertion: "HTTP headers not included in file system".
2021-03-04 21:16:48 +01:00
Oliver Hitz
b5176936c7 tcp: make tcp_listen() inherit the netbuf_idx of the original pcb
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>
2021-03-04 21:15:25 +01:00
Simon Goldschmidt
3666dcc66c tcp: send RST to input netif when no pcb is available
If we know there's no matchin pcb (e.g. for routing), don't even
try to pass NULL but instead send the RST to the input netif.

See also patch #9988.
2021-03-04 21:10:28 +01:00
Simon Goldschmidt
1f4a029d10 mqtt: check data_cb != NULL 2021-03-04 20:18:04 +01:00
Simon Goldschmidt
d7a0757764 mqtt: allow calling mqtt_set_inpub_callback before mqtt_client_connect
See also patch #10037
2021-03-04 20:14:46 +01:00
Christoffer Lind
600e248f06 dhcp: generate new xid for DHCP release 2021-03-02 22:49:57 +01:00
Erik Ekman
988ce1e80e netif: Add test for netif_find 2021-02-27 12:28:14 +01:00
Erik Ekman
e02d126b07 lowpan6: Use arch-independent printf formatters 2021-02-13 21:14:29 +01:00
Erik Ekman
74231d6873 netif: Add test for netif_is_flag_set() 2021-02-08 19:29:33 +01:00
Thomas Mueller
7a2923020f Fix typo in definition of netif_is_flag_set() macro 2021-02-08 19:17:20 +01:00
Simon Goldschmidt
12b45506dd fs_example: fix comment in fs_wait_read_custom
See bug #59866
2021-01-30 22:13:29 +01:00
Simon Goldschmidt
9aae444f49 pbuf_free: remove outdated comment about packet queues
See bug #59875
2021-01-30 22:08:36 +01:00
Simon Goldschmidt
3e098f90df pbuf: fix allocating large PBUF_RAM
See bug #59974
2021-01-30 22:06:46 +01:00
Mike Kleshov
6fee08daab httpd: revert part of previous change
pextension needs to be zeroed in case fs_file structure
is reused in a persistent HTTP connection
2021-01-29 08:02:56 +03:00
yuanjm
b00a05d086 lwip_selscan: lwip_selscan return -1 without setting errno number
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2021-01-28 21:00:37 +01:00
Simon Goldschmidt
fc5b6f7b0e lwiperf: fix double-free of pcb on error
See bug #59841 (PCB double-free happened at lwiperf TCP error)

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2021-01-28 20:00:11 +01:00
Mike Kleshov
9b040624c0 httpd: follow-up to previous commit
see bug #59876
2021-01-28 19:53:57 +03:00
Mike Kleshov
69725292a0 httpd: wrap fs_file::pextension in a config macro
see bug #59876
2021-01-28 08:29:25 +03:00
Mike Kleshov
89dca4588f httpd: follow-up to previous commit, replace strstr() with memcmp() 2021-01-27 19:28:19 +03:00
Mike Kleshov
fdd702e61b httpd: fix bug #58223 2021-01-26 19:19:32 +03:00
Mike Kleshov
1678b21a94 httpd: remove fs_file::is_custom_file, use fs_file::flags instead 2021-01-25 21:49:17 +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
651d0af0b6 netdb: Accept '0' as service in lwip_getaddrinfo
Fixes bug #59925
2021-01-22 20:20:51 +01:00
Erik Ekman
c825eb3604 tcp: Check tcp_output return values in tests
Found with clang-analyzer
2021-01-19 20:19:02 +01:00
Erik Ekman
21fba21054 test/unit: Update convenience makefile
Allow cleaning - useful when switching compiler between GCC/clang.
2021-01-19 20:19:02 +01:00
Erik Ekman
b5618c51ca altcp: Fix memory leak in altcp_tls_free_config
Reported in bug #59032 by Ondrej Lufinka,
fix suggested by David GIRAULT.
2021-01-13 22:19:47 +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
7b77378ed8 test/unit: Fix compilation of ip4 test
../../../../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
2021-01-13 21:31:19 +01:00
Erik Ekman
d0c214feff test/unit: Add convenience Makefile
To allow running them easily on *nix without changing directory.
2021-01-13 20:57:23 +01:00
Erik Ekman
35550eeab3 icmp: Fix copied length in response packets
Fixes bug #59364, reported by Yi Guai
2021-01-13 20:31:55 +01:00
Mike Kleshov
c6777547f6 Make sure tag insertion is complete when tag is followed by EOF.
See bug #59728.

Signed-off-by: Mike Kleshov <m.kleshov@gmail.com>
2021-01-01 11:26:30 +03:00
Erik Ekman
2d0c49adca Clean up COPYING
No need to have comment block.
2020-12-05 09:48:51 +01:00
Erik Ekman
d6a37b1ad6 fuzz: Improve Makefile
Similar to recent change to ports/unix/check:
- Split depfile into three different files
- Fix make dep
- Skip depfile generation for 'make clean'
2020-12-04 10:51:11 +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