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.
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.
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.
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
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