From 42c5aaad5a18d1564d616eac5379011a4340a1f0 Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Thu, 15 Jul 2021 16:34:44 +0200 Subject: [PATCH] use inet_ntop instead of inet_ntoa (STILL BROKEN THOUGH) --- src/TNetwork.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/TNetwork.cpp b/src/TNetwork.cpp index 30c8ad6..2e0064f 100644 --- a/src/TNetwork.cpp +++ b/src/TNetwork.cpp @@ -254,7 +254,10 @@ void TNetwork::HandleDownload(SOCKET TCPSock) { void TNetwork::Authentication(const TConnection& ClientConnection) { auto Client = CreateClient(ClientConnection.Socket); - Client->SetIdentifier("ip", inet_ntoa(reinterpret_cast(&ClientConnection.SockAddr)->sin_addr)); + char AddrBuf[30]; + inet_ntoa(reinterpret_cast(&ClientConnection.SockAddr)->sin_addr); + auto str = inet_ntop(AF_INET, static_cast(reinterpret_cast(&ClientConnection.SockAddr)), AddrBuf, sizeof(struct sockaddr_in)); + Client->SetIdentifier("ip", str); std::string Rc; info("Identifying new ClientConnection...");