Skip to content
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

[examples]: Make multi-netif example working with DNS_PER_DEFAULT_NETIF #609

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

david-cermak
Copy link
Collaborator

Latest IDF supports CONFIG_ESP_NETIF_SET_DNS_PER_DEFAULT_NETIF config option which restores global DNS server information from "per-netif" records whenever a new netif is selected for routing (set as default).

};
size_t num_of_ifaces = sizeof(ifaces) / sizeof(ifaces[0]);

while (true) {
// For demonstration purposes we clear DNS table every iteration to exercise
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we try to move this out of a loop and have it set twice only? One with the regular expected way users would do and after that we clean and do as demo? We could consider keep the loop as is as long as we have once the expected way clearly stated.

@@ -19,6 +19,9 @@ This example demonstrates working with multiple different interfaces with differ
* It tries to reconfigure DNS server if host name resolution fails
* It tries to manually change the default interface if connection fails

This example demonstrate how DNS servers could be handled on network interface level, as lwIP used global DNS server information. All network interfaces store the DNS info upon acquiring an IP in the internal structure and the DNS servers are restored if host name resolution fails.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth to add a subsection for the DNS part to improve reading.

@@ -1,2 +1,5 @@
# You can use CONFIG_ESP_NETIF_SET_DNS_PER_DEFAULT_NETIF
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we expect this to be the default for users? If so, we should enable it here and point in README how to disable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants