Skip to content

Commit 8f2ca2b

Browse files
committed
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.
1 parent 0675a58 commit 8f2ca2b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

features/net/network-socket/SocketAddress.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ void SocketAddress::_SocketAddress(NetworkStack *iface, const char *host, uint16
274274
} else {
275275
// DNS lookup
276276
int err = iface->gethostbyname(this, host);
277+
_port = port;
277278
if (err) {
278279
_addr = nsapi_addr_t();
279280
_port = 0;

0 commit comments

Comments
 (0)