]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/s_auth.c
irc_string.h -> match.h, irc_string.h; includes changed
[irc/rqf/shadowircd.git] / src / s_auth.c
index 7fe61bb1ac207cad65062ef2a144a3d26a9f762b..2ea496db7fb6a7af55c898e9a9c2e5a22b2698d6 100644 (file)
 #include "s_conf.h"
 #include "client.h"
 #include "common.h"
-#include "irc_string.h"
-#include "sprintf_irc.h"
+#include "match.h"
 #include "ircd.h"
 #include "numeric.h"
 #include "packet.h"
 #include "res.h"
-#include "s_log.h"
+#include "logger.h"
 #include "s_stats.h"
 #include "send.h"
 #include "hook.h"
@@ -199,7 +198,7 @@ auth_dns_callback(void *vptr, struct DNSReply *reply)
                                good = 0;
                        }
                }
-#ifdef IPV6
+#ifdef RB_IPV6
                else if(auth->client->localClient->ip.ss_family == AF_INET6)
                {
                        struct sockaddr_in6 *ip, *ip_fwd;
@@ -222,7 +221,7 @@ auth_dns_callback(void *vptr, struct DNSReply *reply)
 
                 if(good && strlen(reply->h_name) <= HOSTLEN)
                 {
-                        strlcpy(auth->client->host, reply->h_name, sizeof(auth->client->host));
+                        rb_strlcpy(auth->client->host, reply->h_name, sizeof(auth->client->host));
                         sendheader(auth->client, REPORT_FIN_DNS);
                 }
                 else if (strlen(reply->h_name) > HOSTLEN)
@@ -240,7 +239,7 @@ auth_dns_callback(void *vptr, struct DNSReply *reply)
 static void
 auth_error(struct AuthRequest *auth)
 {
-       ++ServerStats->is_abad;
+       ++ServerStats.is_abad;
 
        rb_close(auth->F);
        auth->F = NULL;
@@ -274,7 +273,7 @@ start_auth_query(struct AuthRequest *auth)
        if((F = rb_socket(family, SOCK_STREAM, 0, "ident")) == NULL)
        {
                ilog_error("creating auth stream socket");
-               ++ServerStats->is_abad;
+               ++ServerStats.is_abad;
                return 0;
        }
 
@@ -304,7 +303,7 @@ start_auth_query(struct AuthRequest *auth)
                    (struct sockaddr *) &localaddr, &locallen);
        
        /* XXX mangle_mapped_sockaddr((struct sockaddr *)&localaddr); */
-#ifdef IPV6
+#ifdef RB_IPV6
        if(localaddr.ss_family == AF_INET6)
        {
                ((struct sockaddr_in6 *)&localaddr)->sin6_port = 0;
@@ -313,13 +312,13 @@ start_auth_query(struct AuthRequest *auth)
        ((struct sockaddr_in *)&localaddr)->sin_port = 0;
 
        destaddr = auth->client->localClient->ip;
-#ifdef IPV6
+#ifdef RB_IPV6
        if(localaddr.ss_family == AF_INET6)
        {
-               ((struct sockaddr_in6 *)&localaddr)->sin6_port = 113;
+               ((struct sockaddr_in6 *)&destaddr)->sin6_port = htons(113);
        } else
 #endif
-       ((struct sockaddr_in *)&localaddr)->sin_port = 113;
+       ((struct sockaddr_in *)&destaddr)->sin_port = htons(113);
        
        auth->F = F;
        SetAuthConnect(auth);
@@ -445,7 +444,7 @@ timeout_auth_queries_event(void *notused)
                        if(IsDoingAuth(auth))
                        {
                                ClearAuth(auth);
-                               ++ServerStats->is_abad;
+                               ++ServerStats.is_abad;
                                sendheader(auth->client, REPORT_FAIL_ID);
                                auth->client->localClient->auth_request = NULL;
                        }
@@ -575,14 +574,14 @@ read_auth_reply(rb_fde_t *F, void *data)
 
        if(s == NULL)
        {
-               ++ServerStats->is_abad;
+               ++ServerStats.is_abad;
                strcpy(auth->client->username, "unknown");
                sendheader(auth->client, REPORT_FAIL_ID);
        }
        else
        {
                sendheader(auth->client, REPORT_FIN_ID);
-               ++ServerStats->is_asuc;
+               ++ServerStats.is_asuc;
                SetGotId(auth->client);
        }