/[svn]/ircd-hybrid-7.2/src/irc_res.c
ViewVC logotype

Diff of /ircd-hybrid-7.2/src/irc_res.c

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

revision 984 by michael, Fri Aug 14 13:18:14 2009 UTC revision 985 by michael, Sat Aug 15 20:31:54 2009 UTC
# Line 70  typedef enum Line 70  typedef enum
70  #ifdef IPV6  #ifdef IPV6
71    REQ_AAAA,  /* Looking up an AAAA */    REQ_AAAA,  /* Looking up an AAAA */
72  #endif  #endif
73    REQ_CNAME, /* We got a CNAME in response, we better get a real answer next */    REQ_CNAME  /* We got a CNAME in response, we better get a real answer next */
   REQ_INT    /* ip6.arpa failed, falling back to ip6.int */  
74  } request_state;  } request_state;
75    
76  struct reslist  struct reslist
# Line 474  do_query_number(struct DNSQuery *query, Line 473  do_query_number(struct DNSQuery *query,
473  {  {
474    char ipbuf[128];    char ipbuf[128];
475    const unsigned char *cp;    const unsigned char *cp;
476  #ifdef IPV6  
   const char *intarpa;  
 #endif  
477    if (addr->ss.ss_family == AF_INET)    if (addr->ss.ss_family == AF_INET)
478    {    {
479      struct sockaddr_in *v4 = (struct sockaddr_in *)addr;      struct sockaddr_in *v4 = (struct sockaddr_in *)addr;
# Line 492  do_query_number(struct DNSQuery *query, Line 489  do_query_number(struct DNSQuery *query,
489      struct sockaddr_in6 *v6 = (struct sockaddr_in6 *)addr;      struct sockaddr_in6 *v6 = (struct sockaddr_in6 *)addr;
490      cp = (const unsigned char *)&v6->sin6_addr.s6_addr;      cp = (const unsigned char *)&v6->sin6_addr.s6_addr;
491    
492      if (request != NULL && request->state == REQ_INT)      sprintf(ipbuf, "%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x."
493        intarpa = "int";                     "%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.ip6.arpa.",
     else  
       intarpa = "arpa";  
   
     (void)sprintf(ipbuf, "%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x."  
                   "%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.ip6.%s.",  
494                    (unsigned int)(cp[15]&0xf), (unsigned int)(cp[15]>>4),                    (unsigned int)(cp[15]&0xf), (unsigned int)(cp[15]>>4),
495                    (unsigned int)(cp[14]&0xf), (unsigned int)(cp[14]>>4),                    (unsigned int)(cp[14]&0xf), (unsigned int)(cp[14]>>4),
496                    (unsigned int)(cp[13]&0xf), (unsigned int)(cp[13]>>4),                    (unsigned int)(cp[13]&0xf), (unsigned int)(cp[13]>>4),
# Line 514  do_query_number(struct DNSQuery *query, Line 506  do_query_number(struct DNSQuery *query,
506                    (unsigned int)(cp[3]&0xf), (unsigned int)(cp[3]>>4),                    (unsigned int)(cp[3]&0xf), (unsigned int)(cp[3]>>4),
507                    (unsigned int)(cp[2]&0xf), (unsigned int)(cp[2]>>4),                    (unsigned int)(cp[2]&0xf), (unsigned int)(cp[2]>>4),
508                    (unsigned int)(cp[1]&0xf), (unsigned int)(cp[1]>>4),                    (unsigned int)(cp[1]&0xf), (unsigned int)(cp[1]>>4),
509                    (unsigned int)(cp[0]&0xf), (unsigned int)(cp[0]>>4), intarpa);                    (unsigned int)(cp[0]&0xf), (unsigned int)(cp[0]>>4));
510    }    }
511  #endif  #endif
512    if (request == NULL)    if (request == NULL)
# Line 819  res_readreply(fde_t *fd, void *data) Line 811  res_readreply(fde_t *fd, void *data)
811          request->timeout += 4;          request->timeout += 4;
812          resend_query(request);          resend_query(request);
813        }        }
       else if (request->type == T_PTR && request->state != REQ_INT &&  
                request->addr.ss.ss_family == AF_INET6)  
       {  
         request->state = REQ_INT;  
         request->timeout += 4;  
         request->retries--;  
         resend_query(request);  
       }  
814      }      }
815  #endif  #endif
816    

Legend:
Removed from v.984  
changed lines
  Added in v.985

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