From 81e5a35d56de9fa7b3c19b6bf9c3139e6481a0ed Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Thu, 31 Jan 2019 07:34:26 +0100 Subject: [PATCH] Show correct address for ipv6 sockets, fixes #7634 (#10505) --- lib/pure/net.nim | 2 +- 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 a5bdf3ce6a9f2..43284f8724f49 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 6c480d03a0064..d1bfbd447743e 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