X-Git-Url: http://git.pk910.de/?p=NextIRCd.git;a=blobdiff_plain;f=src%2Fircd_auth.c;h=8079db1c78ff89092687b1ca5a1be44eba316dca;hp=0478f9b25b3ee319666d031908f237c055000678;hb=e17a8a5dc929df2a5ae6169f1955fcde7c70e04b;hpb=285018f265af0f32438a5de357905963daaaa86f diff --git a/src/ircd_auth.c b/src/ircd_auth.c index 0478f9b..8079db1 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 "struct_auth.h" #include "struct_connection.h" #include "ircd_client.h" @@ -36,7 +39,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; return auth; @@ -63,13 +66,11 @@ static IODNS_CALLBACK(auth_dns_callback) { client_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 + if(auth->conn->ipv6) inet_ntop(AF_INET6, (void *)(&((struct sockaddr_in6 *)sockaddr->address)->sin6_addr), auth->host, HOSTLEN); - } + else + inet_ntop(AF_INET, (void *)(&((struct sockaddr_in *)sockaddr->address)->sin_addr), auth->host, HOSTLEN); + client_printf(auth->conn, "NOTICE AUTH :*** Couldn't look up your hostname. Using your IP instead (%s)", auth->host); } if(dnsresult)