Skip to content

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);
}

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