Commit Graph

6858 Commits

Author SHA1 Message Date
Abhik Roy 6233a15612 dns: add addr_cnt to DNS resolution to fix multi-IP buffer overflow
Introduce dns_gethostbyname_addrtype_n and netconn_gethostbyname_*_n so
callers pass how many ip_addr_t slots they provide. Thread addr_cnt
through dns_lookup, dns_enqueue, dns_requests, and struct dns_api_msg;
copy only addr_cnt entries in lwip_netconn_do_dns_found instead of always
writing DNS_MAX_HOST_IP.

Keep the single-address helpers as thin wrappers (addr_cnt == 1).
lwip_gethostbyname and lwip_getaddrinfo use DNS_MAX_HOST_IP via the _n
APIs. Bound dns_lookup cache output to addr_cnt; zero new dns_table
entry ipaddr slots. Clarify the cached-address doc for
dns_gethostbyname_addrtype.
2026-05-27 20:19:28 +10:00
David Cermak a4e2409d0d ci: Add jira sync github workflows
also adds a specific tag to gitlab-ci job
2026-05-18 15:58:45 +08:00
Ashish Sharma 20f8b0739c feat(lwip): migrate to to PSA API interface 2025-12-18 15:29:52 +05:30
David Cermak e9b8482e75 test: Fix multiple defs of util vars 2025-07-16 11:20:03 +02:00
David Cermak 2a14051bfb ci: Add support for building tests/apps with both gcc and clang 2025-07-16 11:19:47 +02:00
Simon Goldschmidt 6933a63cbc try to fix unit test compiling with clang 2025-07-16 11:01:45 +02:00
Erik Ekman b6209dcf89 apps/snmp: Remove @retval tags on void methods
Fixing clang 19.1.0 error:
src/apps/snmp/snmp_traps.c:140:15: error: empty paragraph passed to '@retval' command [-Werror,-Wdocumentation]
2025-07-16 11:01:45 +02:00
Jan Breuer 6659cf1f2c snmp: Mention struct field removal in UPGRADING 2025-07-16 11:00:50 +02:00
Jan Breuer f32188001b snmp: remove unused prev field from snmp_varbind 2025-07-16 11:00:50 +02:00
Jan Breuer 46660d5cf3 snmp: remove handling of varbind->prev because it is never used
No code in snmp traverses varbinds backwards so prev is never used.
This also fixes false positive dangling pointer detection by GCC.
2025-07-16 11:00:50 +02:00
Jan Breuer 0e3e97f8df snmp: fix dangling pointer in snmp_traps 2025-07-16 11:00:50 +02:00
chendejin fd432e4ee2 nd6: add a unit test case for nd6 rio support 2025-05-28 12:23:00 +08:00
chendejin 1adc49f981 nd6: support route information option in router advertisement
Co-authored-by: David Čermák <cermak@espressif.com>
Co-authored-by: Wang Qixiang <wangqixiang@espressif.com>
2025-05-28 10:41:06 +08:00
Xu Si Yu ebabd6d79c ip6: add some unit test cases for ip6 forwarding 2025-02-27 16:20:08 +08:00
Xu Si Yu adcd330ee1 ip6: clone the buf when forwarding a PBUF_REF packet 2025-02-27 16:19:14 +08:00
Abhik Roy 0a44efa10f napt: Fixed NULL pointer dereference in ip_napt_enable
Prevent potential NULL pointer dereference when calling ip_napt_enable()
with invalid addresses. Add validation to ensure NAPT can only be
enabled/disabled for existing network interfaces.
2025-02-10 02:57:53 +00:00
Abhik Roy 865d7d0cae napt: Added unit tests for napt 2025-02-10 02:57:23 +00:00
David Cermak fa4dffdfac autoip: Choose next address after rate limit 2024-11-28 12:51:10 +01:00
David Cermak a587d92989 test: Add tcp-pcb recycle test 2024-11-13 15:45:29 +08:00
LiPeng 3bfc85d29c tcp: Apply faster PCB recycling in FIN_WAIT_1 or FIN_WAIT_2 state 2024-11-13 15:45:29 +08:00
David Cermak 0c9c39a957 test: Add tcp alloc limitation test 2024-11-13 15:45:29 +08:00
LiPeng 9cb96ac151 memp: Employ TCP-PCB allocation limit if libc malloc used 2024-11-13 15:45:29 +08:00
David Cermak c816f0ee5c sockets: Make IPv6 only netconn type IPv6 aware 2024-10-30 19:31:53 +08:00
David Cermak 3ec12c3be0 test: Make test application scalable
also fixes github CI and makes the linger stress test run multiple times
2024-10-23 10:56:22 +02:00
Abhik Roy b15cd2de75 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-10-08 21:59:57 +11:00
David Cermak f150e2321a ci/docs: Update CHANGELOG and publish v2.2.0-esp
Remaining commits from 2.1.3-esp but missing in 2.2.0-esp
2.1.3-esp: 2f700738 dhcp: Remove invalid warning in dhcp-state related logs
- not needed as we're logging dhcp state changes inside dhcp_set_state()
2.1.3-esp: 0866f578 ci: Introduce lwip test apps
- already present in the initial CI commit (f49974d8)
2.1.3-esp: ec115c72 ci: Publish branch 2.1.3-esp if CI passes
- already present in the initial CI commit (f49974d8)
2.1.3-esp: 8a5a30dd PPP: Add test exhibiting empty packet null-deref
- upstreamed as 6b734bbb
2.1.3-esp: b5934a2c PPP: Fix null-deref when processing wrong packet
- upstreamed as a9664395
2.1.3-esp: c35e4d32 ppp: Fix potential array overflow
- upstreamed as 2ee3cbe69
2.1.3-esp: f978e87f dhcp: Add hook for appending extra client's request options
- upstreamed as 3aa82745
2.1.3-esp: 729d724c dhcp: Set hostname for DISCOVER packets
- upstreamed as 90b2a6b4
2.1.3-esp: 73a92e31 dhcp: Enable custom config for timeouts, thresholds, delays
- upstreamed as 00f5e179 and 5231c8da
2.1.3-esp: 72105e53 tcp: Make retransmission timeout (RTO) configurable
- upstreamed as 239918cc
2.1.3-esp: 5f246f5f ci: Add unit test suite to validate tcp state transitions
- upstreamed as f50c87da
2.1.3-esp: 4a2fb780 ci: Add github/lab build/run unit tests on linux
- already present in the initial CI commit (f49974d8)
2.1.3-esp: 08f1b41d ci: Update esp-lwip's version to 2.1.3-esp
- not needed
2024-09-11 16:37:26 +02:00
WanqQixiang 3a393c9b57 dns: Add support for external resolve hook in TCPIP context
2.1.3-esp: 0606eed9 feat(lwip): Add DNS external resolve hook
2024-09-11 16:29:30 +02:00
zwx 0deed15b03 nd6: Handle NS packets without LL opt to send NA response
2.1.3-esp: 6bc36ec0 ND6: reply NS without LL opt
2024-09-11 16:29:30 +02:00
David Cermak fbce255b84 ppp: Add mbedtls includes to PPP auth methods if lwip uses it
2.1.3-esp: e8d05138 PPP/Auth: Add mbedtls includes if lwip uses it
2024-09-11 16:29:30 +02:00
David Cermak ab2870dbbd dns: Add support to set dnsserver() with netif if enabled
2.1.3-esp: 3a3d1fb3 dns: Allow storing dnsserver per netif
2024-09-11 16:29:30 +02:00
Abhik Roy dcb01b9121 dns: Add support for multiple DNS/IP records
2.1.3-esp: f1746813 feat(lwip): Added multiple dns ip support
2.1.3-esp: bced058f dns: Fixed incorrect handling of 0.0.0.0
2024-09-11 16:29:30 +02:00
David Cermak 6e7c96f5fd api_msg: Fix unused local variable if LWIP_NETCONN_SEM_PER_THREAD=1
2.1.3-esp: aa4f6e78 api_msg: Fix unused local variable if LWIP_NETCONN_SEM_PER_THREAD=1
2024-09-11 16:29:30 +02:00
David Cermak fb0faa4dce api_msg: Add fail-safe error handling for semaphore allocation failure
2.1.3-esp: a1bd9e44 api_msg: Fix crash to fail-safe error if cannot get semaphore
2024-09-11 16:29:30 +02:00
Alexey Lapshin 3380732a7e Fix gcc -fanalyzer warnings in icmp6.c and udp.c
2.1.3-esp: 4297782b lwip: fix gcc -fanalyzer warnings
2024-09-11 16:29:30 +02:00
zwx 0199ba3b65 nd6: Add support to force router forwarding flag in NA
2.1.3-esp: 542ba299 fix router forwarding flag set
2024-09-11 16:29:30 +02:00
David Cermak 9aae28d074 api_msg: Fix potential tcp_abort() thread safety issue
2.1.3-esp: 10197b21 api_msg: fix tcp_abort thread safety
2024-09-11 16:29:30 +02:00
David Cermak 353e8ff2da timers: Conditionally enable ACD timer per DHCP ARP check (2.2.0) 2024-09-11 16:29:30 +02:00
David Cermak 6091d39eca ci: Remove invalid/non-unicode chars (2.2.0) 2024-09-11 16:29:30 +02:00
Christoph Baechler c7c3996488 dns: Fix fallback server init config with preferred IP4
2.1.3-esp: 5aab73d7 dns: fix init with only ipv4 enabled
2.1.3-esp: f7922143 feat(lwip):add fall back dns config in menuconfig
2024-09-11 16:29:08 +02:00
xueyunfei b58c9660f2 tcp: Fix retransmission timeout handling for TCP connections in SYN_RCVD state
2.1.3-esp: 6bf7044c bugfix for optimize tcp connection
2024-09-11 09:10:14 +02:00
Deomid "rojer" Ryabkov 3462f21a38 napt: Fixes and improvements (2.2.0)
2.1.3-esp: fadb9109 napt: Fixes and improvements (2.1.3)
2.1.3-esp: 5c4f899f napt: restore to the initial state in deinit
2.1.3-esp: d65ad241 napt: Fix ip_portmap_add() to keep only one port mapping
2.1.3-esp: 7033e26f napt: Fix clean compilation
2.1.3-esp: bc78df87 napt: Fix IP forwarding when forward netif enable NAPT
2.1.3-esp: b55e64ae napt/stats: Move some napt counters to stats module
2.1.3-esp: a7e0a50c ip_napt_maint: Fix timestamp overflow handling (2.1.3)
2.1.3-esp: partially f5c43549 lwip_debug: Fixed string format error in ip6 and napt
2024-09-11 09:04:46 +02:00
David Cermak faa7ff4f43 Add sbom descripton file for Software BOM
2.1.3-esp: f07097d7 Add sbom descripton file for Software BOM
2024-09-11 09:00:09 +02:00
xiaqilin 0a1828f74e nd6: Add support to enable/disable ND6 protocol
2.1.3-esp: 7896c6ca lwip: add LWIP ND6 config
2024-09-11 08:59:18 +02:00
David Cermak a5b12956da Fix printf format warnings with strict -Wformat
2.1.3-esp: 894e387f Fix print format issues repored for -Wformat
2.1.3-esp: partiallly f5c43549 lwip_debug: Fixed string format error in ip6 and napt
2024-09-11 08:53:01 +02:00
David Cermak 46c037d52c test: Fix test apps linux port alloc size
2.1.3-esp: d6b00609 test: Fix test apps linux port alloc size
2024-09-11 08:52:46 +02:00
zhangwenxu 966a90af26 ip6: Add hook for IP6 source address selection
2.1.3-esp: 57c29648 ip6: add a hook for ip6 source address selection
2024-09-11 08:28:59 +02:00
xueyunfei 3a924184ec netdb: Fix getaddrinfo() bug returning NULL on IP4 mapped address
2.1.3-esp: dafc8225 netdb:fixed bug for getaddrinfo returns null when IPV4 mapped address
2024-09-11 08:27:52 +02:00
xueyunfei a1a9b0346b tcp_in/ooseq: Fix incorrect segment trim when FIN moved
2.1.3-esp: 9e62afff tcp_in/ooseq: Fix incorrect segment trim when FIN moved
2024-09-11 08:27:28 +02:00
Abhik Roy d6a2a9c022 netdb: Fix addrtype and length in gethostbyname
2.1.3-esp: aee6b3ed netdb:fixed addrtype and length in gethostbyname
2024-09-11 08:21:32 +02:00
Abhik Roy b79877bd32 napt: Add support to enable/disable NAPT port mapping
2.1.3-esp: 6fba06a7 lwip/napt: Added option to enable or disable Port mapping in NAPT.
2024-09-11 08:20:48 +02:00