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.
pull/2246/head
Christopher Haster 2016-07-25 17:40:05 -05:00
parent 0675a58009
commit 8f2ca2bc63
1 changed files with 1 additions and 0 deletions

View File

@ -274,6 +274,7 @@ void SocketAddress::_SocketAddress(NetworkStack *iface, const char *host, uint16
} else { } else {
// DNS lookup // DNS lookup
int err = iface->gethostbyname(this, host); int err = iface->gethostbyname(this, host);
_port = port;
if (err) { if (err) {
_addr = nsapi_addr_t(); _addr = nsapi_addr_t();
_port = 0; _port = 0;