Commit Graph

116 Commits

Author SHA1 Message Date
David Cermak
58b0def0d9 lwip: Fix on-demand timers to update internal system touts
If on-demand timers (IGMP+MLD6) were enabled, idf updated user config
MEMP_NUM_SYS_TIMEOUT. The implementation of these timers are in lwip
project so the internal system timeout shall be updated accordingly,
enabling port layers to modify MEMP_NUM_SYS_TIMEOUT.

Closes https://github.com/espressif/esp-idf/issues/9150
2022-07-14 05:09:53 +00:00
Ondrej Kosta
53082a22f7 esp_netif: added support for LwIP bridge
examples: created bridge example
2022-06-14 15:29:44 +02:00
David Cermak
c67f4c2b4c lwip: Remove vanilla-lwip config until it's fully deployable 2022-06-02 20:45:24 +02:00
David Cermak
7efcb5e625 lwip: Add missing null-checks, rename to vanilla-lwip 2022-06-01 20:38:40 +02:00
David Cermak
00377cf2e5 lwip/ci: Cleanup public header checker ignore list 2022-06-01 14:36:58 +02:00
David Cermak
e7f19f39bc lwip: Fix the CI 2022-05-18 17:11:35 +02:00
David Cermak
a6154a5f10 lwip: Update default MEMP_NUM_SYS_TIMEOUT if timers on-demand 2022-05-18 17:11:35 +02:00
David Cermak
5d6afa3c4b dhcp: Implement additional dhcp options 2022-05-18 17:11:35 +02:00
David Cermak
1564e8d5a9 lwip: Implement DHCP hook supporting MTU option 2022-05-18 17:11:35 +02:00
David Cermak
b6eb9002a8 add dhcp custom values 2022-05-18 17:11:35 +02:00
David Cermak
356bc603c4 lwip: Support DHCP restore last IP 2022-05-18 17:11:35 +02:00
David Cermak
53c009e626 lwip: Update socket API to include port-version of sockets/netdb
Added socket extention to the lwip hooks for implementing non-vanilla
{get/set}sockopts()
2022-05-18 17:10:42 +02:00
David Cermak
dbc91f73e6 lwip: Use custom pbufs for eth and wifi port/netif 2022-05-18 17:10:42 +02:00
David Cermak
65bf5f2b10 lwip: Add mem-heap options to support ALLOCATION_FROM_SPIRAM_FIRST 2022-05-18 17:10:42 +02:00
David Cermak
06263efe0b lwip: Add IPv4 route hook to the esp32 port 2022-05-18 17:10:42 +02:00
David Cermak
808ac7427a lwip: Add freertos sys-arch port layer
Added sys_thread_sem_func(), sys_sem_signal_isr(), g_lwip_task
2022-05-18 17:10:42 +02:00
David Cermak
5b471a1848 esp_netif/lwip: Implement basic support for vanilla-lwip (2.1.3-REL)
* Reference lwip-2.1.3-REL vanilla lwip version
* Use inherent NETIF callbacks instead of dhcp/ipv6/autoip
2022-05-18 17:10:42 +02:00
Darian Leung
e08d574a5d lwip: Update AFL host test mock
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
2022-04-29 15:11:44 +08:00
Darian Leung
4e4f20d82a lwip: Fix extra or missing includes 2022-04-29 15:11:44 +08:00
Jeff H
5ebd86ab6a add option to route LWIP logs through ESP_LOG interface
Signed-off-by: xueyunfei <xueyunfei@espressif.com>

Merges https://github.com/espressif/esp-idf/pull/8785
Closes https://github.com/espressif/esp-idf/issues/8361
2022-04-25 16:35:04 +08:00
David Čermák
3692b15965 Merge branch 'feature/lwip_dns_debug_logs' into 'master'
lw-IP: Add DNS debug option.

Closes IDFGH-7076

See merge request espressif/esp-idf!17668
2022-04-06 21:59:09 +08:00
Mengsk
42efbb1a57 Add lwip dns debug option. 2022-03-30 15:45:56 +02:00
David Cermak
c005b04d1c lwip/dhcps: Support for dynamic dhcp server instances 2022-03-13 19:39:21 +01:00
David Cermak
92f7ecd632 lwip: Security fixes; PPPoS null-deref; NAPT ip-forward
* 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
2022-03-08 09:38:42 +01:00
Sudeep Mohanty
a9fda54d39 esp_hw_support/esp_system: Re-evaluate header inclusions and include directories
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.
2022-03-07 11:18:08 +05:30
David Čermák
004c02b8bd Merge branch 'contrib/github_pr_8164' into 'master'
Replace lwIP byte order functions with built-in functions (GitHub PR)

Closes IDFGH-6512

See merge request espressif/esp-idf!16627
2022-01-18 12:35:12 +00:00
David Cermak
5d7489eae4 lwip: Fix minor lwip dependency issue
Clean-up config option rename file
2022-01-14 16:41:38 +01:00
David Cermak
cfc52bacbc lwip: Cleanup lwipopts flags and options
* Removed unused and flags
* Fixed comments
* Order of flags lwip/esp-specific
* Used 1/0 logic for boolean flags
2022-01-14 16:41:38 +01:00
Jiacheng Guo
d6c4e2cb34 lwip: add ip6 input hook
The MR adds Kconfig options and a default weak implementation for the
lwIP ip6 input hook.
2022-01-13 12:23:38 +08:00
David Cermak
6f2e0d53a4 lwip: Fix spacing issue 2022-01-07 16:38:40 +01:00
José Simões
dd9fe9761a
Replace lwIP byte order functions with built-in functions 2021-12-29 09:49:18 +00:00
Liu Han
49cd81ccf3 lwip/dhcp: add configure for enable vendor class identify option
Closes https://github.com/espressif/esp-idf/issues/6786
2021-10-22 11:17:59 +08:00
yuanjm
9e2f15ae51 lwip: Support DHCP option length configuration 2021-09-18 17:24:27 +08:00
David Cermak
213727c4f2 lwip: IPv6: Add support for DHCPv6 stateless config
Closes https://github.com/espressif/esp-idf/issues/5245
2021-09-07 14:48:21 +08:00
Jiang Jiang Jian
cec0f5edfb Merge branch 'optimization/config_option_LWIP_TCPIP_CORE_LOCKING' into 'master'
optimization config option LWIP_TCPIP_CORE_LOCKING

Closes IDF-2478

See merge request espressif/esp-idf!11809
2021-08-25 08:52:43 +00:00
David Cermak
e54523708d Merge branch 'master' into feature/lwip_sntp_max_servers 2021-08-24 18:16:07 +02:00
David Cermak
457d837b40 lwip: Fix sntp custom options if sntp_get_system_time used 2021-08-23 11:47:44 +02:00
xueyunfei
0d07569fff optimization config option LWIP_TCPIP_CORE_LOCKING 2021-08-18 21:32:13 +08:00
Emil Muratov
34be62665c lwip: menuconfig option to enable ntp servers option request via DHCP
This could be toggled on/off, off is the default.
SNTP debug option. Example update for ntp via DHCP

Signed-off-by: Emil Muratov <gpm@hotplug.ru>
2021-08-02 01:21:35 +03:00
Emil Muratov
80810971c8 lwip menuconfig option for max number of SNTP servers
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>
2021-07-27 22:38:36 +03:00
David Čermák
f86140eb8d Merge branch 'feature/add_rdnss_kconfig' into 'master'
lw-ip: Add ND6 RDNSS DNS server Kconfig option

Closes IDFGH-5209

See merge request espressif/esp-idf!14090
2021-06-24 18:51:43 +00:00
liuhan
7d5ae1ee26 esp_netif: Add CONFIG_LWIP_DHCPS to sperate the code 2021-06-24 09:49:45 +08:00
yuanjm
b0e1a8e752 lwip: Add ND6 RDNSS DNS server Kconfig option
Closes https://github.com/espressif/esp-idf/issues/6982
2021-06-23 10:09:26 +08:00
liuhan
2d80c122b1 lwip: Add CONFIG_LWIP_ICMP and CONFIG_LWIP_ICMP6 to sperate the code 2021-06-21 15:14:19 +08:00
Shu Chen
e470e7c4c3 Merge branch 'feature/ot-lwip-interface' into 'master'
openthread: add lwIP network interface

See merge request espressif/esp-idf!13188
2021-06-03 01:46:17 +00:00
Jiacheng Guo
52a68cb7fe openthread: integrate OpenThread network interface with esp_netif 2021-06-02 17:03:54 +08:00
Angus Gratton
0fc9253ed9 lwip: Update public port-layer headers with c++ guards, sdkconfig include
This doesn't fix any particular bug, just to meet best practices. Although
including some LWIP headers from C++ files may have caused linker issues.
2021-05-18 16:09:17 +10:00
David Cermak
49022e99f5 lwip: Add config for DHCP client id; Fix DNS server idx assert issue
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
2021-05-07 14:11:51 +02:00
Jiacheng Guo
fd3553b66d lwip: add config options for Thread IPv6 border routing 2021-04-22 06:13:47 +00:00
yuanjm
ef7583517d lwip: Fix LWIP_DEBUG define which is always defined 2021-04-12 14:41:46 +00:00