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

Fix DNS get methods #809

Merged
merged 1 commit into from
Jan 9, 2024
Merged

Fix DNS get methods #809

merged 1 commit into from
Jan 9, 2024

Conversation

manchoz
Copy link
Contributor

@manchoz manchoz commented Dec 22, 2023

This PR fixes the ::dnsServerIP() and ::dnsIP() methods to retrieve the DNS server configuration properly.

The issue is due to NetworkInterface.cpp#L111-L112 ultimately requiring the interface name because of lwip_dns.c#L505-L506

@JAndrassy
Copy link
Contributor

JAndrassy commented Dec 22, 2023

DHCP sets the DNS server IP for specific interface_name. so they must be retrieved with the right interface_name.

for curios this is the implementation of get_dns_server in NetworkInterface.cpp in Mbed OS

nsapi_error_t NetworkInterface::get_dns_server(int index, SocketAddress *address, const char *interface_name)
{
    return get_stack()->get_dns_server(index, address, interface_name);
}

@facchinm facchinm merged commit b6ed803 into arduino:main Jan 9, 2024
11 checks passed
@manchoz manchoz deleted the fix_get_dns branch January 9, 2024 11:00
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