-
Notifications
You must be signed in to change notification settings - Fork 17
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
[dns] allow to specify an interface to use DNS servers that are specific it during lookup #17
base: particle
Are you sure you want to change the base?
Conversation
a9e7d33
to
5bf5129
Compare
…fic it during lookup
5bf5129
to
2464af8
Compare
@@ -1653,14 +1676,20 @@ dns_gethostbyname_addrtype(const char *hostname, ip_addr_t *addr, dns_found_call | |||
#endif /* LWIP_DNS_SUPPORT_MDNS_QUERIES */ | |||
{ | |||
/* prevent calling found callback if no server is set, return error instead */ | |||
if (next_server_index(0) == DNS_MAX_SERVERS) { | |||
if (next_server_index(0, if_idx) == DNS_MAX_SERVERS) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know you didnt change this logic, but is the intent to switch to the next potential DNS server to use to resolve the address if we failed to resolve the address? or is this just a check that we have any usable DNS server?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Next server that is associated with this interface. If if_idx == 0
, it's any next server in the list. If it's not 0, only subsequent ones that match LWIP_HOOK_DNS_GET_NETIF_FOR_SERVER_INDEX(i)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, if the start_index
parameter of next_server_index()
is always passed as zero, wont it always use the first one it finds that matches that index? It just walks through the dns_servers[]
array starting from zero each time? Im wondering how this worked before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is just a check to see if any dns server is available (for our interface specifically). The iterating happens elsewhere in dns_backupserver_available()
and dns_check_entry()
Looks good to me |
…