From 8f2ca2bc63e105cd9fc1925013d22624af80ad77 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Mon, 25 Jul 2016 17:40:05 -0500 Subject: [PATCH] Fixed missing port assignment in DNS constructor for SocketAddress _stack->gethostbyname looks deceptively like it completely sets the socket address value, however port is not provided via DNS resolution. --- features/net/network-socket/SocketAddress.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/features/net/network-socket/SocketAddress.cpp b/features/net/network-socket/SocketAddress.cpp index 0ca1370f95..a6e9fb7cf4 100644 --- a/features/net/network-socket/SocketAddress.cpp +++ b/features/net/network-socket/SocketAddress.cpp @@ -274,6 +274,7 @@ void SocketAddress::_SocketAddress(NetworkStack *iface, const char *host, uint16 } else { // DNS lookup int err = iface->gethostbyname(this, host); + _port = port; if (err) { _addr = nsapi_addr_t(); _port = 0;