- iodns_print_address(sockaddr, auth->conn->socket->ipv6, auth->host, HOSTLEN);
- client_printf(auth->conn, "NOTICE AUTH :*** Couldn't look up your hostname. Using your IP instead (%s)", auth->host);
+ if(sockaddr->addresslen == sizeof(struct sockaddr_in)) {
+ //ipv4
+ inet_ntop(AF_INET, (void *)(&((struct sockaddr_in *)sockaddr->address)->sin_addr), auth->host, HOSTLEN);
+ } else {
+ //ipv6
+ inet_ntop(AF_INET6, (void *)(&((struct sockaddr_in6 *)sockaddr->address)->sin6_addr), auth->host, HOSTLEN);
+ }
+ socket_printf(auth->conn, "NOTICE AUTH :*** Couldn't look up your hostname. Using your IP instead (%s)", auth->host);