Commit a59b9ce4 authored by rswindell's avatar rswindell
Browse files

A little more detail for inet_addrtop() failures, but still not working for

failed login attempt client IP addresses on Windows.
parent fef0922e
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html *
* CopyrightRob Swindell - http://www.synchro.net/copyright.html *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
......@@ -439,7 +439,7 @@ const char* DLLCALL inet_addrtop(union xp_sockaddr *addr, char *dest, size_t siz
{
#ifdef _WIN32
if(getnameinfo(&addr->addr, xp_sockaddr_len(addr), dest, size, NULL, 0, NI_NUMERICHOST))
strncpy(dest, "<Unable to convert address>", size);
safe_snprintf(dest, size, "<Error %u converting address, family=%u>", WSAGetLastError(), addr->addr.sa_family);
return dest;
#else
switch(addr->addr.sa_family) {
......@@ -452,7 +452,7 @@ const char* DLLCALL inet_addrtop(union xp_sockaddr *addr, char *dest, size_t siz
dest[size-1]=0;
return dest;
default:
safe_snprintf(dest, size, "<unknown address>");
safe_snprintf(dest, size, "<unknown address family: %u>", addr->addr.sa_family);
return NULL;
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment