mirror of
https://github.com/ShaYmez/P25Clients.git
synced 2024-11-25 13:48:45 -05:00
Merge pull request #219 from miguelestrada/miguelestrada-correct-ip-address
display correct IP address
This commit is contained in:
commit
6b46309ba8
@ -169,14 +169,14 @@ char* CUDPSocket::display(const sockaddr_storage& addr, char* buffer, unsigned i
|
||||
switch (addr.ss_family) {
|
||||
case AF_INET: {
|
||||
struct sockaddr_in* in4 = (struct sockaddr_in*)&addr;
|
||||
::inet_ntop(AF_INET, &in4, buffer, length);
|
||||
::inet_ntop(AF_INET, &in4->sin_addr, buffer, length);
|
||||
::sprintf(buffer + ::strlen(buffer), ":%u", in4->sin_port);
|
||||
}
|
||||
break;
|
||||
|
||||
case AF_INET6: {
|
||||
struct sockaddr_in6* in6 = (struct sockaddr_in6*)&addr;
|
||||
::inet_ntop(AF_INET6, &in6, buffer, length);
|
||||
::inet_ntop(AF_INET6, &in6->sin6_addr, buffer, length);
|
||||
::sprintf(buffer + ::strlen(buffer), ":%u", in6->sin6_port);
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user