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

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

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

revision 6493 by michael, Thu Aug 27 09:59:42 2015 UTC revision 6494 by michael, Sat Sep 5 17:00:42 2015 UTC
# Line 342  check_server(const char *name, struct Cl Line 342  check_server(const char *name, struct Cl
342    
343    assert(client_p);    assert(client_p);
344    
345    /* loop through looking for all possible connect items that might work */    /* Loop through looking for all possible connect items that might work */
346    DLINK_FOREACH(node, server_items.head)    DLINK_FOREACH(node, server_items.head)
347    {    {
348      conf = node->data;      conf = node->data;
# Line 375  check_server(const char *name, struct Cl Line 375  check_server(const char *name, struct Cl
375    
376    attach_conf(client_p, server_conf);    attach_conf(client_p, server_conf);
377    
378      switch (server_conf->aftype)
   if (server_conf)  
379    {    {
380      struct sockaddr_in *v4;      case AF_INET6:
381      struct sockaddr_in6 *v6;      {
382          const struct sockaddr_in6 *v6 = (struct sockaddr_in6 *)&server_conf->addr;
383    
384      switch (server_conf->aftype)        if (IN6_IS_ADDR_UNSPECIFIED(&v6->sin6_addr))
385            memcpy(&server_conf->addr, &client_p->connection->ip, sizeof(struct irc_ssaddr));
386          break;
387        }
388        case AF_INET:
389      {      {
390        case AF_INET6:        const struct sockaddr_in *v4 = (struct sockaddr_in *)&server_conf->addr;
         v6 = (struct sockaddr_in6 *)&server_conf->addr;  
391    
392          if (IN6_IS_ADDR_UNSPECIFIED(&v6->sin6_addr))        if (v4->sin_addr.s_addr == INADDR_NONE)
393            memcpy(&server_conf->addr, &client_p->connection->ip, sizeof(struct irc_ssaddr));          memcpy(&server_conf->addr, &client_p->connection->ip, sizeof(struct irc_ssaddr));
394          break;        break;
       case AF_INET:  
         v4 = (struct sockaddr_in *)&server_conf->addr;  
   
         if (v4->sin_addr.s_addr == INADDR_NONE)  
           memcpy(&server_conf->addr, &client_p->connection->ip, sizeof(struct irc_ssaddr));  
         break;  
395      }      }
396    }    }
397    

Legend:
Removed from v.6493  
changed lines
  Added in v.6494

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