feat(lwip): Added multiple dns ip support (v5.3)

LWIP submodule update on v5.3: git log --oneline f7922143..f1746813
  - feat(lwip): Added multiple dns ip support
    (espressif/esp-lwip@f1746813)
  - api_msg: Fix crash to fail-safe error if cannot get semaphore
    (espressif/esp-lwip@a1bd9e44)
This commit is contained in:
Abhik Roy 2024-04-17 23:56:11 +10:00 committed by David Cermak
parent 0bbd728196
commit 0f08a5b123
4 changed files with 20 additions and 6 deletions

View File

@ -669,7 +669,7 @@ menu "LWIP"
LWIP_TCP_RECCVMBOX_SIZE packets for each TCP socket, so the maximum possible cached TCP packets
for all TCP sockets is LWIP_TCP_RECCVMBOX_SIZE multiples the maximum TCP socket number. In other
words, the bigger LWIP_TCP_RECVMBOX_SIZE means more memory.
On the other hand, if the receiv mail box is too small, the mail box may be full. If the
On the other hand, if the receive mail box is too small, the mail box may be full. If the
mail box is full, the LWIP drops the packets. So generally we need to make sure the TCP
receive mail box is big enough to avoid packet drop between LWIP core and application.
@ -813,7 +813,7 @@ menu "LWIP"
UDP_RECCVMBOX_SIZE packets for each UDP socket, so the maximum possible cached UDP packets
for all UDP sockets is UDP_RECCVMBOX_SIZE multiples the maximum UDP socket number. In other
words, the bigger UDP_RECVMBOX_SIZE means more memory.
On the other hand, if the receiv mail box is too small, the mail box may be full. If the
On the other hand, if the receive mail box is too small, the mail box may be full. If the
mail box is full, the LWIP drops the packets. So generally we need to make sure the UDP
receive mail box is big enough to avoid packet drop between LWIP core and application.
@ -1060,12 +1060,12 @@ menu "LWIP"
SNTP callback for such replies should be set accordingly (see sntp_servermode_dhcp() func.)
config LWIP_DHCP_MAX_NTP_SERVERS
int "Maximum number of NTP servers aquired via DHCP"
int "Maximum number of NTP servers acquired via DHCP"
default 1
range 1 16
depends on LWIP_DHCP_GET_NTP_SRV
help
Set maximum number of NTP servers aquired via DHCP-offer.
Set maximum number of NTP servers acquired via DHCP-offer.
Should be less or equal to "Maximum number of NTP servers", any extra servers would be just ignored.
config LWIP_SNTP_UPDATE_DELAY
@ -1101,6 +1101,12 @@ menu "LWIP"
menu "DNS"
config LWIP_DNS_MAX_HOST_IP
int "Maximum number of IP addresses per host"
default 1
help
Maximum number of IP addresses that can be returned by DNS queries for a single host.
config LWIP_DNS_MAX_SERVERS
int "Maximum number of DNS servers"
default 3

@ -1 +1 @@
Subproject commit f79221431fa9042b3572d271d687de66da7560c4
Subproject commit f174681317a00d209e374c66d9691ef79b4195de

View File

@ -470,6 +470,10 @@ static inline uint32_t timeout_from_offered(uint32_t lease, uint32_t min)
*/
#define LWIP_DNS 1
/** The maximum number of IP addresses per host
*/
#define DNS_MAX_HOST_IP CONFIG_LWIP_DNS_MAX_HOST_IP
/** The maximum of DNS servers
*/
#define DNS_MAX_SERVERS CONFIG_LWIP_DNS_MAX_SERVERS
@ -1103,7 +1107,7 @@ static inline uint32_t timeout_from_offered(uint32_t lease, uint32_t min)
/**
* PPP_MAXIDLEFLAG: Max Xmit idle time (in ms) before resend flag char.
* TODO: If PPP_MAXIDLEFLAG > 0 and next package is send during PPP_MAXIDLEFLAG time,
* then 0x7E is not added at the begining of PPP package but 0x7E termination
* then 0x7E is not added at the beginning of PPP package but 0x7E termination
* is always at the end. This behaviour brokes PPP dial with GSM (PPPoS).
* The PPP package should always start and end with 0x7E.
*/

View File

@ -459,6 +459,10 @@ Limitations
ESP-IDF additions to lwIP still suffer from the global DNS limitation, described in :ref:`lwip-dns-limitation`. To address this limitation from application code, the ``FALLBACK_DNS_SERVER_ADDRESS()`` macro can be utilized to define a global DNS fallback server accessible from all interfaces. Alternatively, you have the option to maintain per-interface DNS servers and reconfigure them whenever the default interface changes.
The number of IP addresses returned by network database APIs such as ``getaddrinfo()`` and ``gethostbyname()`` is restricted by the macro ``DNS_MAX_HOST_IP``. By default, the value of this macro is set to 1.
In the implementation of ``getaddrinfo()``, the canonical name is not available. Therefore, the ``ai_canonname`` field of the first returned ``addrinfo`` structure will always refer to the ``nodename`` argument or a string with the same contents.
Calling ``send()`` or ``sendto()`` repeatedly on a UDP socket may eventually fail with ``errno`` equal to ``ENOMEM``. This failure occurs due to the limitations of buffer sizes in the lower-layer network interface drivers. If all driver transmit buffers are full, the UDP transmission will fail. For applications that transmit a high volume of UDP datagrams and aim to avoid any dropped datagrams by the sender, it is advisable to implement error code checking and employ a retransmission mechanism with a short delay.
.. only:: esp32