Skip to content

Commit

Permalink
Merge pull request #1023 from pennam/getHostbyname-ip-version
Browse files Browse the repository at this point in the history
SocketHelpers: use NSAPI_IPv4 for dns resolution
  • Loading branch information
pennam authored Feb 5, 2025
2 parents d00befa + 599c24b commit 53a89c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libraries/SocketWrapper/src/SocketHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,11 @@ SocketAddress arduino::MbedSocketClass::socketAddressFromIpAddress(arduino::IPAd
nsapi_error_t arduino::MbedSocketClass::gethostbyname(NetworkInterface* interface, const char* aHostname, SocketAddress* socketAddress) {
char ifname[5] {};
interface->get_interface_name(ifname);
return interface->gethostbyname(aHostname, socketAddress, NSAPI_UNSPEC, ifname);
nsapi_version_t version = NSAPI_IPv4;
#if MBED_CONF_LWIP_IPV6_ENABLED
version = NSAPI_UNSPEC;
#endif
return interface->gethostbyname(aHostname, socketAddress, version, ifname);
}

// Download helper
Expand Down

0 comments on commit 53a89c3

Please sign in to comment.