use inet_ntop instead of inet_ntoa (STILL BROKEN THOUGH)

This commit is contained in:
Lion Kortlepel
2021-07-15 16:34:44 +02:00
parent b071906db5
commit d39b5d7c77

View File

@@ -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<const struct sockaddr_in*>(&ClientConnection.SockAddr)->sin_addr));
char AddrBuf[30];
inet_ntoa(reinterpret_cast<const struct sockaddr_in*>(&ClientConnection.SockAddr)->sin_addr);
auto str = inet_ntop(AF_INET, static_cast<const void*>(reinterpret_cast<const struct sockaddr_in*>(&ClientConnection.SockAddr)), AddrBuf, sizeof(struct sockaddr_in));
Client->SetIdentifier("ip", str);
std::string Rc;
info("Identifying new ClientConnection...");