/[svn]/ircd-hybrid/trunk/src/res.c
ViewVC logotype

Diff of /ircd-hybrid/trunk/src/res.c

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

revision 8880 by michael, Tue Jan 1 11:07:01 2019 UTC revision 8881 by michael, Sun Apr 14 16:03:29 2019 UTC
# Line 140  make_request(dns_callback_fnc callback, Line 140  make_request(dns_callback_fnc callback,
140  static bool  static bool
141  res_ourserver(const struct irc_ssaddr *inp)  res_ourserver(const struct irc_ssaddr *inp)
142  {  {
   const struct sockaddr_in6 *v6in = (const struct sockaddr_in6 *)inp;  
   const struct sockaddr_in *v4in = (const struct sockaddr_in *)inp;  
   
143    for (unsigned int i = 0; i < irc_nscount; ++i)    for (unsigned int i = 0; i < irc_nscount; ++i)
144    {      if (address_compare(inp, &irc_nsaddr_list[i], true) == true)
145      const struct irc_ssaddr *srv = &irc_nsaddr_list[i];        return true;
     const struct sockaddr_in6 *v6 = (const struct sockaddr_in6 *)srv;  
     const struct sockaddr_in *v4 = (const struct sockaddr_in *)srv;  
   
     /*  
      * Could probably just memcmp(srv, inp, srv.ss_len) here  
      * but we'll air on the side of caution - stu  
      */  
     switch (srv->ss.ss_family)  
     {  
       case AF_INET6:  
         if (srv->ss.ss_family == inp->ss.ss_family)  
           if (v6->sin6_port == v6in->sin6_port)  
             if (memcmp(&v6->sin6_addr.s6_addr, &v6in->sin6_addr.s6_addr, sizeof(struct in6_addr)) == 0)  
               return true;  
         break;  
       case AF_INET:  
         if (srv->ss.ss_family == inp->ss.ss_family)  
           if (v4->sin_port == v4in->sin_port)  
             if (v4->sin_addr.s_addr == v4in->sin_addr.s_addr)  
               return true;  
         break;  
       default:  
         break;  
     }  
   }  
146    
147    return false;    return false;
148  }  }

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

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