This commit updates and refactors the AFL host test mock as follows:
- Isolates the mock so that it only relies on lwip component and linux stdlib headers
- Grouped all mock functions in 'esp32_mock.h/c'
- Updates the lwip esp32 port files to include 'esp32_mock.h' when building for linux
- Use host stdlib headers instead of xtensa stdlib headers
* Cherry-pick important fixes to 2.1.2-esp
- CVE-2020-22283: Attacker could craft a packet that would disclose 8 bytes of some heap memory:
- icmp6: Don't copy too much data
- icmp6: Fix copying of chained pbuf in reply
- icmp6: keep to the RFC and send as much as possible with icmp6 error messages
- CVE-2020-22284: ZEP - ZigBee Encapsulation Protocol/6LoWPAN is not supported in IDF,
the netif module (zepif.c) is not included in the build, but users can still inject
the file into compilation process, implement IO interface and use this.
- zepif: Copy possibly chained output pbuf properly
- Add #define for minimum IPv6 MTU length
- pbuf: Add pbuf_copy_partial_pbuf library function
* PPPoS: Fix null-deref when processing double break packet
- pppos: fix in_tail null (espressif/esp-lwip@537c69d5)
- PPP: Add test exhibiting empty packet null-deref (espressif/esp-lwip@202a07da)
* NAPT: Fix PBUF_REF type to clone the pbuf before forwarding
- IP-FORWARD: If packet-type is PBUF_REF clone it before forwarding
- Add NAPT unit test to exercise NAT feature for both RAM and REF pbuf types
* version: Update version numbers to match 2.1.2-esp
* Update submodule: 2749568fe1...76303df238
- test/napt: Add unit test for IP forward with PBUF_REF (espressif/esp-lwip@76303df2)
- napt: Fix PBUF_REF type to clone the pbuf before forwarding (espressif/esp-lwip@39068263)
- version: Update version numbers to match 2.1.2-esp (espressif/esp-lwip@2b922919)
- pppos: fix in_tail null (espressif/esp-lwip@537c69d5)
- PPP: Add test exhibiting empty packet null-deref (espressif/esp-lwip@202a07da)
- pbuf: Add pbuf_copy_partial_pbuf library function (espressif/esp-lwip@1c9cd9c1)
- Add #define for minimum IPv6 MTU length (espressif/esp-lwip@d2dc577b)
- zepif: Copy possibly chained output pbuf properly (espressif/esp-lwip@64ab7f2a)
- icmp6: Don't copy too much data (espressif/esp-lwip@4a64731b)
- icmp6: Fix copying of chained pbuf in reply (espressif/esp-lwip@7c822ff4)
- icmp6: keep to the RFC and send as much as possible with icmp6 error messages (espressif/esp-lwip@29100ab6)
- dns: Add API to clear dns cache (espressif/esp-lwip@ee59f77d)
- CI: Fixed adding gitlab key (espressif/esp-lwip@5a2bdba7)
- test case: modify test case test_tcp_new_max_num_remove_FIN_WAIT_1 (espressif/esp-lwip@6b090f7d)
Closes https://github.com/espressif/esp-idf/issues/8300
Closes https://github.com/espressif/esp-idf/issues/8451
This commit updates the visibility of various header files and cleans up
some unnecessary inclusions. Also, this commit removes certain header
include paths which were maintained for backward compatibility.
`lwip_select` uses `sys_arch_sem_wait` function making the assumption that it
is POSIX compliant. This commit makes that function wait for at least
timeout (milliseconds), as required by POSIX specification.
* Relates to https://github.com/espressif/esp-idf/issues/7514
This commit removes the usage of all legacy FreeRTOS data types that
are exposed via configENABLE_BACKWARD_COMPATIBILITY. Legacy types can
still be used by enabling CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY.
LWIP has two definess for setting max number of sntp servers:
- Total number of handled servers
- max number of sntp's picked via DHCP
by default both values are equal to 1, but could be set separately
Signed-off-by: Emil Muratov <gpm@hotplug.ru>
This commit brings two esp-lwip fixes to IDF:
1) Add configuration to disable DHCP client identification
2195f7416f
This config could be used to disable option 61 in DHCP packets, so that
clients will be identified by their chaddr only.
(This is the lwip upstream original behaviour)
2) Fix server_idx increasing to DNS_MAX_SERVERS and trigger the LWIP_ASSERT
5a567d52f7
When lwip doesn't have DNS server and resolve a domain address, the server_idx
will increase to DNS_MAX_SERVERS, which will trigger the LWIP_ASSERT and make device crash.
Closes https://github.com/espressif/esp-idf/issues/6878
If silent assert configuration is enabled, LWIP asserts are now 'silent' also.
Also updates KConfig to note that LWIP asserts are also disabled when asserts
are disabled globally (this was already the behaviour, but the config item
suggested otherwise.)
Progress towards https://github.com/espressif/esp-idf/issues/5873
This caused some unsigned int prints out to be printed as singed integer which made the logs unreadable, for example sequence numbers in TCP packet headers
LWIP_HOOK_FILENAME is used in IDF to define standard and default hooks for IDF port in LWIP.
Added ESP_IDF_LWIP_HOOK_FILENAME to customize additional hooks in lwip
Closes https://github.com/espressif/esp-idf/issues/6261
Added lwIP hooks which could be optionally overwritten in the
application code. These three options are provided in Kconfig:
* NONE: No hook support
* DEFAULT: Default implementation is provided. If IDF doesn't
have a specific hook implementation, an empty stub is provided, which
could be overwritten by strong implementation in application code.
* CUSTOM: Hooks are declared only to be implemented in application code.
Merges https://github.com/espressif/esp-idf/pull/6034
* If CONFIG_VFS_SUPPORT_IO=y, keep everything as it is now
* If CONFIG_VFS_SUPPORT_IO=n, defined syscalls which LwIP can
implement, such as read/write/close
* Make LWIP-only select implementation dependent on
CONFIG_VFS_SUPPORT_SELECT, deprecate CONFIG_LWIP_USE_ONLY_LWIP_SELECT
Make the link local negotiation for IPV6 in PPP optional and
configurable.
This is because some modems do not support the IPV6 negotiation and
sending IPV6CP frames would in some cases break the network
configuration phase, resulting in a timeout during the Phase Network.
Please note that this does not disable the IPV6 support for the outgoing
communication (IPV6 is still enabled even if this option is not
selected) but just for the local link between lwIP and modem.
Signed-off-by: Francesco Giancane <francesco.giancane@accenture.com>
Merges https://github.com/espressif/esp-idf/pull/4782
Closes https://github.com/espressif/esp-idf/issues/1065
On startup of the common interface (ethernet, wifi), the lwip netif hostname was assigned to confg value .
Fixed to assign to esp-netif hostname if it exists
Closes https://github.com/espressif/esp-idf/issues/4737
SOMAXCONN is expected to be defined in this header, but for the esp32
port is found in net/if.h from newlib.
Avoid the issue by including the net/if.h header in sys/socket.h so that
compatibility is preserved.
Signed-off-by: Francesco Giancane <francesco.giancane@accenture.com>
Merges https://github.com/espressif/esp-idf/pull/4637
Some applications (i.e. Azure IoT SDK) are expecting this header to
exist and to contain the tcp constants and description.
The esp32 did not wrap the lwip/tcp.h header, thus this commit adds a
compatibility layer.
Signed-off-by: Francesco Giancane <francesco.giancane@accenture.com>
Merges https://github.com/espressif/esp-idf/pull/4637