X-Git-Url: http://git.pk910.de/?p=NextIRCd.git;a=blobdiff_plain;f=src%2Fircd_auth.c;h=22325f484e491da3072907098369ded701647b08;hp=56f4481ab9c9c207eac4c9748615bb1bc2a9f75d;hb=4e79b9632a41b2c7d2fecb4e4514692f9cf7e7f9;hpb=ffef7816a745964e42bbf7409975b127bb454152 diff --git a/src/ircd_auth.c b/src/ircd_auth.c index 56f4481..22325f4 100644 --- a/src/ircd_auth.c +++ b/src/ircd_auth.c @@ -14,6 +14,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ +#include + +#include "ircd_auth.h" #include "struct_auth.h" #include "struct_connection.h" #include "ircd_client.h" @@ -21,6 +24,7 @@ #include "IOHandler/IODNSLookup.h" #include "version.h" +static void auth_start_dnsreverse(struct Auth *auth); static IODNS_CALLBACK(auth_dns_callback); static void auth_free(struct Auth *auth); @@ -37,7 +41,7 @@ struct Auth *auth_new(struct Connection *conn) { auth->prev = authlist_last; auth->next = NULL; if(!authlist_last) - authlist_first = auth + authlist_first = auth; authlist_last = auth; auth_start_dnsreverse(auth); @@ -45,7 +49,7 @@ struct Auth *auth_new(struct Connection *conn) { return auth; } -void auth_start_dnsreverse(struct Auth *auth) { +static void auth_start_dnsreverse(struct Auth *auth) { socket_printf(auth->conn, "NOTICE AUTH :*** Looking up your hostname"); struct IODNSAddress *sockaddr; @@ -68,13 +72,7 @@ static IODNS_CALLBACK(auth_dns_callback) { socket_printf(auth->conn, "NOTICE AUTH :*** Found your hostname (%s)", auth->host); } else { struct IODNSAddress *sockaddr = iosocket_get_remote_addr(auth->conn->socket); - 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); - } + iodns_print_address(sockaddr, auth->conn->socket->ipv6, auth->host, HOSTLEN); socket_printf(auth->conn, "NOTICE AUTH :*** Couldn't look up your hostname. Using your IP instead (%s)", auth->host); } if(dnsresult)