6393 Commits

Author SHA1 Message Date
392707e5c3 dns: Handle active DNS entries before clearing cache
Issue:
A bug was identified where calling dns_clear_cache() after a DNS query request
but before the query response is received causes the dns_clear_cache() function
to clear the dns_table database. This results in the netconn layer
waiting indefinitely for the dns_call_found() callback, leading to a deadlock.

Resolution:
Added logic to invoke dns_call_found() for any active DNS entries before
clearing the entire DNS cache in the dns_clear_cache() function.
This change ensures that in-use entries are handled properly,
preventing the system from entering a deadlock state.
2024-12-16 11:03:03 +01:00
149b87eba4 sockets: Make IPv6 only netconn type IPv6 aware 2024-12-11 09:50:27 +01:00
d2e3d21a85 tcp: Apply faster PCB recycling in FIN_WAIT_1 or FIN_WAIT_2 state 2024-11-21 10:50:54 +01:00
5be5d89890 memp: Employ TCP-PCB allocation limit if libc malloc used 2024-11-21 10:50:46 +01:00
0606eed9d8 feat(lwip): Add DNS external resolve hook 2024-08-29 14:21:01 +08:00
zwx
6bc36ec020 ND6: reply NS without LL opt
* This issue should be fixed for the upstream
* Reference to the RFC-4861#section-4.3 source Link-Layer address
  SHOULD be included in unicast solicitations. But there might be
  some NS messages which do not contain source link-layer address option.
* NA will be replied to those NS messages which do not contain
  source link layer option.
2024-08-27 17:39:04 +08:00
f1c0a3d820 dhcp: Remove invalid warning in dhcp-state related logs
Introduced in 1343f47b0
2024-08-21 16:47:46 +08:00
bced058f73 dns: Fixed incorrect handling of 0.0.0.0
Fixes regression introduced by commit f1746813
2024-08-14 22:50:05 +10:00
e8d0513898 PPP/Auth: Add mbedtls includes if lwip uses it 2024-07-12 10:42:01 +02:00
3a3d1fb3e3 dns: Allow storing dnsserver per netif 2024-06-21 17:08:34 +08:00
aa4f6e780f api_msg: Fix unused local variable if LWIP_NETCONN_SEM_PER_THREAD=1
Closes CID 460613: Uninitialized pointer read in api_lib.c, netconn_gethostbyname_addrtype
2024-06-10 14:15:50 +08:00
4297782bf9 lwip: fix gcc -fanalyzer warnings 2024-06-06 17:21:55 +08:00
f174681317 feat(lwip): Added multiple dns ip support 2024-05-14 19:15:36 +10:00
a1bd9e441b api_msg: Fix crash to fail-safe error if cannot get semaphore 2024-03-20 10:53:18 +01:00
f79221431f feat(lwip):add fall back dns config in menuconfig 2024-01-22 14:06:46 +08:00
f5c43549e5 lwip_debug: Fixed string format error in ip6 and napt 2023-11-27 09:07:20 +00:00
5aab73d78f dns: fix init with only ipv4 enabled 2023-11-23 10:18:02 +00:00
zwx
542ba2997f fix router forwarding flag set 2023-11-15 10:53:32 +08:00
4a8286ab8b optimize add TCP ooseq buf timeout configuration 2023-10-25 20:29:52 +08:00
6bf7044c03 bugfix for optimize tcp connection 2023-10-13 13:58:46 +08:00
5c4f899f8e napt: restore to the initial state in deinit
This bug casue NAPT not work as normal after deinit then reinit
2023-09-25 19:41:48 +10:00
d65ad241a2 napt: Fix ip_portmap_add() to keep only one port mapping 2023-09-22 23:42:08 +10:00
7033e26f3a napt: Fix clean compilation
Unused variable introduced in fb1f35523
2023-09-22 23:27:00 +10:00
bc78df87fd napt: Fix IP forwarding when forward netif enable NAPT
* Fix communication between different netifs fails if NAPT is enabled
* Fixes IDF-4896
2023-09-22 23:27:00 +10:00
b55e64aedb napt/stats: Move some napt counters to stats module 2023-09-22 23:26:56 +10:00
a7e0a50c4d ip_napt_maint: Fix timestamp overflow handling (2.1.3)
s_last_now was not being updated once overflow happened.
2023-09-22 23:24:34 +10:00
fadb910946 napt: Fixes and improvements (2.1.3)
1. Fix enable/disable to properly allocate and deallocate tables.
    Current algorithm is just broken.
 2. Introduce eviction policy when table gets full: oldest connection
    is evicted, instead of new ones getting silently dropped. this
    results in much better behavior with small tables than before.
    When TCP connection is dropped, RSTs are sent both ways to inform
    parties instead of dropping silently. thiw requires additional 8
    bytes per entry but is, again, a big improvement for clients in
    terms of usability.
 3. FIxed handling of timestamp wraparound (every ~50 days of uptime).
 3. Added ip_portmap_get() to retrieve current port mapping settings.
 4. Added ip_napt_get_stats() for some insight into the state of NAT.
2023-09-22 23:24:29 +10:00
f07097d740 Add sbom descripton file for Software BOM
This file is used by the esp-idf-sbom tool to generate
an SBOM file in the SPDX format for esp-idf projects.
2023-09-20 11:52:54 +00:00
90009cc2b0 lwip/napt: Added necessary #include to lwip_napt.h 2023-09-18 07:39:35 +00:00
6fba06a715 lwip/napt: Added option to enable or disable Port mapping in NAPT. 2023-09-18 07:39:35 +00:00
7896c6cad0 lwip: add LWIP ND6 config 2023-08-18 14:12:58 +08:00
8dad8d3ee6 Fix: Added check to ensure safe restart of dhcp fine timer 2023-08-15 15:02:47 +00:00
894e387f5c Fix print format issues repored for -Wformat 2023-08-15 08:50:21 +00:00
d6b006094b test: Fix test apps linux port alloc size
This is a minor fix, as sys_sem_t is defined as
`typedef struct sys_sem * sys_sem_t;`
so the size is still the same (size of pointer)

Closes https://github.com/espressif/esp-lwip/issues/54
2023-08-14 09:09:45 +00:00
269a58f185 lower the dhcp discover and request retry backoff time 2023-06-16 10:47:43 +08:00
57c29648ff ip6: add a hook for ip6 source address selection 2023-05-30 11:31:31 +00:00
dafc822531 netdb:fixed bug for getaddrinfo returns null when IPV4 mapped address 2023-05-05 20:32:00 +08:00
d5e56d0665 dhcp: Fix dhcp_fine_tmr() not to use netif after free
Introduced in 86df9f44
2023-03-13 15:14:58 +08:00
9e62afffb4 tcp_in/ooseq: Fix incorrect segment trim when FIN moved
In case FIN flag was present in the *next* segment,
it's copied to the current *inseg* and thus it's length
needs to be adjusted, so the segment is trimmed correctly.
2023-03-13 10:54:09 +08:00
aee6b3ed0c netdb:fixed addrtype and length in gethostbyname
Fix for the h_length field of struct hostent returned by gethostbyname() functions was returning 24 bytes instead of 4 and h_addrtype was returning AF_INET even for IPv6 address.

Closes https://github.com/espressif/esp-lwip/issues/50
2023-02-22 18:49:16 +11:00
280c3d61d9 lwip/napt: Added api to enable/disable napt based on lwip netif. 2023-02-13 09:27:25 +00:00
86df9f44bb lwip/dhcp: Fixed ondemand fine timers bug, that allowed only one dhcp
client to run at a time without issue.
2023-01-20 13:45:56 +00:00
10197b212a api_msg: fix tcp_abort thread safety
As this tcp_abort could be directly called by application thread without
locking the TCP/TP core.

This commit also reworks and fixes CI:
1) Unit tests build with format-f warnings with GCC-11
2) Reworked to use common shell scripts from both GitLab and GitHub CI
2023-01-09 07:32:37 +01:00
46227e21de Fixes d058bbbe to unref socket for both core-lock configs 2023-01-05 19:20:55 +01:00
705dd71d46 dhcp:init fine timer when dhcp start 2022-11-15 16:48:41 +08:00
9813ea9ab2 lwip:optimization lwip ip6 reassembly timer 2022-11-15 14:08:27 +08:00
ce1a7099fa optimization lwip ip4 reassembly timer 2022-11-08 18:12:34 +08:00
6b0bfc2e4a lwip:optimization lwip dns timer 2022-11-08 10:14:42 +08:00
33912690ea reduce the DHCP Request timeout 2022-11-03 12:00:18 +08:00
c3e9aa1cef lwip:Bugfix for get ip fail when stress test 2022-11-01 20:48:41 +08:00