mirror of
https://github.com/osmarks/ngircd.git
synced 2025-09-10 06:16:01 +00:00
Display IPv6 addresses as "[<addr>]" when accepting connections.
With this patch ngIRCd displays IPv6 addresses as "[<addr>]:<port>" when accepting new connections and later, if no successful DNS lookup could be made (or DNS is disabled altogether).
This commit is contained in:
@@ -1261,14 +1261,21 @@ New_Connection( int Sock )
|
|||||||
My_Connections[new_sock].addr = new_addr;
|
My_Connections[new_sock].addr = new_addr;
|
||||||
My_Connections[new_sock].client = c;
|
My_Connections[new_sock].client = c;
|
||||||
|
|
||||||
Log( LOG_INFO, "Accepted connection %d from %s:%d on socket %d.", new_sock,
|
/* Set initial hostname to IP address. This becomes overwritten when
|
||||||
ip_str, ng_ipaddr_getport(&new_addr), Sock);
|
* the DNS lookup is enabled and succeeds, but is used otherwise. */
|
||||||
|
if (ng_ipaddr_af(&new_addr) != AF_INET)
|
||||||
/* Hostnamen ermitteln */
|
snprintf(My_Connections[new_sock].host,
|
||||||
strlcpy(My_Connections[new_sock].host, ip_str, sizeof(My_Connections[new_sock].host));
|
sizeof(My_Connections[new_sock].host), "[%s]", ip_str);
|
||||||
|
else
|
||||||
|
strlcpy(My_Connections[new_sock].host, ip_str,
|
||||||
|
sizeof(My_Connections[new_sock].host));
|
||||||
|
|
||||||
Client_SetHostname(c, My_Connections[new_sock].host);
|
Client_SetHostname(c, My_Connections[new_sock].host);
|
||||||
|
|
||||||
|
Log(LOG_INFO, "Accepted connection %d from %s:%d on socket %d.",
|
||||||
|
new_sock, My_Connections[new_sock].host,
|
||||||
|
ng_ipaddr_getport(&new_addr), Sock);
|
||||||
|
|
||||||
identsock = new_sock;
|
identsock = new_sock;
|
||||||
#ifdef IDENTAUTH
|
#ifdef IDENTAUTH
|
||||||
if (Conf_NoIdent)
|
if (Conf_NoIdent)
|
||||||
|
Reference in New Issue
Block a user