/[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 994 by michael, Fri Aug 21 09:15:31 2009 UTC revision 995 by michael, Fri Aug 21 10:11:14 2009 UTC
# Line 108  static int send_res_msg(const char *buf, Line 108  static int send_res_msg(const char *buf,
108  static void resend_query(struct reslist *request);  static void resend_query(struct reslist *request);
109  static int proc_answer(struct reslist *request, HEADER *header, char *, char *);  static int proc_answer(struct reslist *request, HEADER *header, char *, char *);
110  static struct reslist *find_id(int id);  static struct reslist *find_id(int id);
 static struct DNSReply *make_dnsreply(struct reslist *request);  
   
 extern struct irc_ssaddr irc_nsaddr_list[IRCD_MAXNS];  
 extern int irc_nscount;  
 extern char irc_domain[HOSTLEN+1];  
111    
112    
113  /*  /*
# Line 273  restart_resolver(void) Line 268  restart_resolver(void)
268  }  }
269    
270  /*  /*
  * add_local_domain - Add the domain to hostname, if it is missing  
  * (as suggested by eps@TOASTER.SFSU.EDU)  
  */  
 void  
 add_local_domain(char *hname, size_t size)  
 {  
   /* try to fix up unqualified names  
    */  
   if (strchr(hname, '.') == NULL)  
   {  
     if (irc_domain[0])  
     {  
       size_t len = strlen(hname);  
   
       if ((strlen(irc_domain) + len + 2) < size)  
       {  
         hname[len++] = '.';  
         strcpy(hname + len, irc_domain);  
       }  
     }  
   }  
 }  
   
 /*  
271   * rem_request - remove a request from the list.   * rem_request - remove a request from the list.
272   * This must also free any memory that has been allocated for   * This must also free any memory that has been allocated for
273   * temporary storage of DNS results.   * temporary storage of DNS results.
# Line 445  do_query_name(dns_callback_fnc callback, Line 416  do_query_name(dns_callback_fnc callback,
416  {  {
417    char host_name[HOSTLEN + 1];    char host_name[HOSTLEN + 1];
418    
419    strlcpy(host_name, name, HOSTLEN + 1);    strlcpy(host_name, name, sizeof(hostname));
   add_local_domain(host_name, HOSTLEN + 1);  
420    
421    if (request == NULL)    if (request == NULL)
422    {    {

Legend:
Removed from v.994  
changed lines
  Added in v.995

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