/[svn]/ircd-hybrid/branches/8.2.x/modules/m_dline.c
ViewVC logotype

Diff of /ircd-hybrid/branches/8.2.x/modules/m_dline.c

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

revision 4643 by michael, Sun Sep 21 11:18:20 2014 UTC revision 4644 by michael, Sun Sep 21 11:37:26 2014 UTC
# Line 265  ms_dline(struct Client *source_p, int pa Line 265  ms_dline(struct Client *source_p, int pa
265    char def_reason[] = CONF_NOREASON;    char def_reason[] = CONF_NOREASON;
266    char *dlhost, *reason;    char *dlhost, *reason;
267    const char *creason;    const char *creason;
   const struct Client *target_p = NULL;  
268    struct irc_ssaddr daddr;    struct irc_ssaddr daddr;
269    struct MaskItem *conf=NULL;    struct MaskItem *conf=NULL;
270    time_t tkline_time=0;    time_t tkline_time=0;
271    int bits = 0, aftype = 0, t = 0;    int bits = 0, aftype = 0, t = 0;
272    const char *current_date = NULL;    const char *current_date = NULL;
   char hostip[HOSTIPLEN + 1];  
273    char buffer[IRCD_BUFSIZE];    char buffer[IRCD_BUFSIZE];
274    
275    if (parc != 5 || EmptyString(parv[4]))    if (parc != 5 || EmptyString(parv[4]))
# Line 295  ms_dline(struct Client *source_p, int pa Line 293  ms_dline(struct Client *source_p, int pa
293                                source_p->username, source_p->host,                                source_p->username, source_p->host,
294                                SHARED_DLINE))                                SHARED_DLINE))
295    {    {
296      if ((t = parse_netmask(dlhost, NULL, &bits)) == HM_HOST)      if ((t = parse_netmask(dlhost, &daddr, &bits)) == HM_HOST)
297      {        return 0;
       if ((target_p = find_chasing(source_p, dlhost)) == NULL)  
         return 0;  /* find_chasing sends ERR_NOSUCHNICK */  
   
       if (!MyConnect(target_p))  
       {  
         if (IsClient(source_p))  
           sendto_one_notice(source_p, &me, ":Cannot DLINE nick on another server");  
         return 0;  
       }  
   
       if (IsExemptKline(target_p))  
       {  
         if (IsClient(source_p))  
           sendto_one_notice(source_p, &me, ":%s is E-lined", target_p->name);  
         return 0;  
       }  
   
       getnameinfo((struct sockaddr *)&target_p->connection->ip,  
                   target_p->connection->ip.ss_len, hostip,  
                   sizeof(hostip), NULL, 0, NI_NUMERICHOST);  
       dlhost = hostip;  
       t = parse_netmask(dlhost, NULL, &bits);  
       assert(t == HM_IPV4 || t == HM_IPV6);  
     }  
298    
299      if (bits < 8)      if (bits < 8)
300      {      {
# Line 334  ms_dline(struct Client *source_p, int pa Line 308  ms_dline(struct Client *source_p, int pa
308      else      else
309        aftype = AF_INET;        aftype = AF_INET;
310    
     parse_netmask(dlhost, &daddr, NULL);  
   
311      if ((conf = find_dline_conf(&daddr, aftype)))      if ((conf = find_dline_conf(&daddr, aftype)))
312      {      {
313        if (!IsClient(source_p))        if (!IsClient(source_p))

Legend:
Removed from v.4643  
changed lines
  Added in v.4644

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