-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Double interface can fail DNS resolution: dns_clear_servers called twice (IDFGH-4440) #6270
Comments
This is a common issue for dual-interface use cases. The problem is lwIP does not support DNS per netif. Maybe esp-lwip can test and pickup this patch. |
@arnoutdekimo @AxelLin Thanks for the report and the pointers. Will check the issue and see if we can cherry-pick the patch. |
Hi, I am working on the release v4.3 and I still have this issue. (LWIP version is 2.1.2) Thank you, |
hi @sguitton I provided a pacth of 4.3, which distinguishes the dns of each netif. If you have any more questions, please feel free to ask them. As for the official patch of lwip, that patch has changed too much for idf, and it will take some time to change it. |
Thanks @AxelLin for pointing me to this, looks like what I need. Please note that with hardware like LilyGo T-SIM7080-S3 (which I have) and the recent Walter board, I expect this to become more important. Also some of the complexity in the esp-protocols example multiple_netifs is due to this. |
I think I may have ported the stuff from 4.3 to v5.2.1 . Current output of my app looks like it should :
|
The limitation is documented in https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/lwip.html#limitations Here's a staus/update of this issue:
|
FYI the stuff I ported to 5.2.1 still appears to work with 5.3-beta1.
Not exactly the same output as before but the repeated DynDNS call (last line) shows it works both before and after enabling a 2nd netif. |
Implemented in 6acdb38 (controlled by |
Thanks. Will this make it into esp-idf v5.3 ? |
Ok, it's not in 5.3 but I patched my version. |
I'll probably backport it to both v5.2 and v5.3 (we don't usually backport features, but this involves lwip, which we'd like to keep ~updated)
Note that the fix (merge commit 6a75241) contains two commits: one with the callback 17a635b, and the other which uses it 6acdb38 (so you don't have to set/use any lwip callbacks)
You just enable the It's briefly documented here: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/kconfig.html#config-esp-netif-set-dns-per-default-netif (Kconfig option descriptions are used to generate this)
Still the same program: https://github.com/espressif/esp-protocols/tree/master/examples/esp_netif/multiple_netifs |
Reopening per comments in #14249. (will close after the fix is accepted by users) |
I've been able to test, and it works for me. Thanks ! PS so basically all I had to do to my networking code is to remove ESP_NETIF_WIFI_DNS_MAIN (compatible with my hack) and replace with the normal ESP_NETIF_DNS_MAIN. |
Yes, please backport to stable branches. |
Hi,
In the v4.2 but also in the 4.3-dev, the https_request_example allows in the sdkconfig to enable both ethernet and wifi. (CONFIG_EXAMPLE_CONNECT_ETHERNET and CONFIG_EXAMPLE_CONNECT_WIFI)
Both will then run a dhcp client and the example will wait until both interfaces are up and have an IP.
However, in the case that one of the two interfaces does not get a DNS server through its DHCP lease, it is possible for no DNS servers to be configured at all, causing all subsequent name resolutions to fail.
What seems to happen is that esp_netif_dhcpc_start_api is called for every interface. In this function all dns servers are cleared. If the slower interface does not restore another dns server, the system will be without any dns server, which is clearly undesired.
(Tested on ESP32-WROOM-32)
Kind regards,
Arnout
The text was updated successfully, but these errors were encountered: