/[svn]/ircd-hybrid/branches/8.2.x/src/auth.c
ViewVC logotype

Diff of /ircd-hybrid/branches/8.2.x/src/auth.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 8879 by michael, Sat Feb 16 21:53:04 2019 UTC revision 8880 by michael, Sun Apr 14 16:02:11 2019 UTC
# Line 51  Line 51 
51  #include "log.h"  #include "log.h"
52  #include "send.h"  #include "send.h"
53  #include "memory.h"  #include "memory.h"
54    #include "misc.h"
55    
56    
57  enum  enum
# Line 190  auth_dns_callback(void *vptr, const stru Line 191  auth_dns_callback(void *vptr, const stru
191      auth_sendheader(auth->client, REPORT_FAIL_DNS);      auth_sendheader(auth->client, REPORT_FAIL_DNS);
192    else    else
193    {    {
194      if (auth->client->ip.ss.ss_family == AF_INET6)      if (address_compare(addr, &auth->client->ip, false) == false)
195      {        auth_sendheader(auth->client, REPORT_IP_MISMATCH);
196        const struct sockaddr_in6 *const v6 = (const struct sockaddr_in6 *)&auth->client->ip;      else if (namelength > HOSTLEN)
       const struct sockaddr_in6 *const v6dns = (const struct sockaddr_in6 *)addr;  
   
       if (memcmp(&v6->sin6_addr, &v6dns->sin6_addr, sizeof(struct in6_addr)))  
       {  
         auth_sendheader(auth->client, REPORT_IP_MISMATCH);  
         auth_release_client(auth);  
         return;  
       }  
     }  
     else  
     {  
       const struct sockaddr_in *const v4 = (const struct sockaddr_in *)&auth->client->ip;  
       const struct sockaddr_in *const v4dns = (const struct sockaddr_in *)addr;  
   
       if (v4->sin_addr.s_addr != v4dns->sin_addr.s_addr)  
       {  
         auth_sendheader(auth->client, REPORT_IP_MISMATCH);  
         auth_release_client(auth);  
         return;  
       }  
     }  
   
     if (namelength > HOSTLEN)  
197        auth_sendheader(auth->client, REPORT_HOST_TOOLONG);        auth_sendheader(auth->client, REPORT_HOST_TOOLONG);
198      else if (auth_verify_hostname(name) == false)      else if (auth_verify_hostname(name) == false)
199        auth_sendheader(auth->client, REPORT_HOST_INVALID);        auth_sendheader(auth->client, REPORT_HOST_INVALID);

Legend:
Removed from v.8879  
changed lines
  Added in v.8880

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28