diff --git a/external/3rd/library/udplibrary/UdpLibrary.cpp b/external/3rd/library/udplibrary/UdpLibrary.cpp index 630e32a3..1299073a 100755 --- a/external/3rd/library/udplibrary/UdpLibrary.cpp +++ b/external/3rd/library/udplibrary/UdpLibrary.cpp @@ -152,6 +152,13 @@ char *UdpIpAddress::GetAddress(char *buffer) const return(buffer); } +char *UdpIpAddress::GetV4Address() const +{ + struct sockaddr_in addr_serverUDP; + addr_serverUDP.sin_addr.s_addr = mIp; + return inet_ntoa(addr_serverUDP.sin_addr); +} + ///////////////////////////////////////////////////////////////////////////////////////////////////// // UdpManager::Params initializations constructor (ie. default values) ///////////////////////////////////////////////////////////////////////////////////////////////////// @@ -1014,7 +1021,7 @@ void UdpManager::ProcessRawPacket(const PacketHistoryEntry *e) if (clientConnections >= mParams.maxConnectionsPerIP) { - printf("Possible DoS attempt? Client %i attempted more connections than the limit (%i). Dropping!\n", e->mIp.GetAddress(), mParams.maxConnectionsPerIP); + printf("Possible DoS attempt? Client %s attempted more connections than the limit (%i). Dropping!\n", e->mIp.GetV4Address(), mParams.maxConnectionsPerIP); return; } } diff --git a/external/3rd/library/udplibrary/UdpLibrary.hpp b/external/3rd/library/udplibrary/UdpLibrary.hpp index 469cf159..0b37907c 100644 --- a/external/3rd/library/udplibrary/UdpLibrary.hpp +++ b/external/3rd/library/udplibrary/UdpLibrary.hpp @@ -99,6 +99,7 @@ class UdpIpAddress public: UdpIpAddress(unsigned int ip = 0); unsigned int GetAddress() const { return(mIp); } + char *GetV4Address() const; char *GetAddress(char *buffer) const; bool operator==(const UdpIpAddress& e) const { return(mIp == e.mIp); } protected: