identd: Fix ipv6 support on Windows

This commit is contained in:
Patrick Griffis 2016-03-28 01:03:39 -04:00
parent 795e97f428
commit bcb4eec754

View File

@ -833,14 +833,14 @@ server_read_child (GIOChannel *source, GIOCondition condition, server *serv)
} }
{ {
struct sockaddr addr; struct sockaddr_storage addr;
int addr_len = sizeof (addr); int addr_len = sizeof (addr);
guint16 port; guint16 port;
ircnet *net = serv->network; ircnet *net = serv->network;
if (!getsockname (serv->sok, &addr, &addr_len)) if (!getsockname (serv->sok, (struct sockaddr *)&addr, &addr_len))
{ {
if (addr.sa_family == AF_INET) if (addr.ss_family == AF_INET)
port = ntohs(((struct sockaddr_in *)&addr)->sin_port); port = ntohs(((struct sockaddr_in *)&addr)->sin_port);
else else
port = ntohs(((struct sockaddr_in6 *)&addr)->sin6_port); port = ntohs(((struct sockaddr_in6 *)&addr)->sin6_port);