diff options
author | LemonBoy <LemonBoy@users.noreply.github.com> | 2019-01-31 07:34:26 +0100 |
---|---|---|
committer | Miran <narimiran@disroot.org> | 2019-01-31 07:34:26 +0100 |
commit | 81e5a35d56de9fa7b3c19b6bf9c3139e6481a0ed (patch) | |
tree | e8063aaabde2dc2937ada3943874bf7516b168ec | |
parent | abcd9fd2e8120caf6e4588dabe0f22ae0cce07d3 (diff) | |
download | Nim-81e5a35d56de9fa7b3c19b6bf9c3139e6481a0ed.tar.gz |
Show correct address for ipv6 sockets, fixes #7634 (#10505)
-rw-r--r-- | lib/pure/net.nim | 2 | ||||
-rw-r--r-- | lib/windows/winlean.nim | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/pure/net.nim b/lib/pure/net.nim index a5bdf3ce6..43284f872 100644 --- a/lib/pure/net.nim +++ b/lib/pure/net.nim @@ -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()) diff --git a/lib/windows/winlean.nim b/lib/windows/winlean.nim index 6c480d03a..d1bfbd447 100644 --- a/lib/windows/winlean.nim +++ b/lib/windows/winlean.nim @@ -896,7 +896,7 @@ proc getProcessTimes*(hProcess: Handle; lpCreationTime, lpExitTime, dynlib: "kernel32", importc: "GetProcessTimes".} type inet_ntop_proc = proc(family: cint, paddr: pointer, pStringBuffer: cstring, - stringBufSize: int32): cstring {.gcsafe, stdcall.} + stringBufSize: int32): cstring {.gcsafe, stdcall, tags: [].} var inet_ntop_real: inet_ntop_proc = nil |