Show correct address for ipv6 sockets, fixes #7634 (#10505)

This commit is contained in:
LemonBoy 2019-01-31 07:34:26 +01:00 • committed by Miran
commit 81e5a35d56
2 changed files with 2 additions and 2 deletions

View file

@ -1295,7 +1295,7 @@ proc recvFrom*(socket: Socket, data: var string, length: int,
if result != -1:
data.setLen(result)
address = $inet_ntoa(sockAddress.sin_addr)
address = getAddrString(cast[ptr SockAddr](addr(sockAddress)))
port = ntohs(sockAddress.sin_port).Port
else:
raiseOSError(osLastError())