mirror of
https://github.com/matrix-construct/construct
synced 2024-08-31 05:45:16 +02:00
Skip cidr checking for hostmask.c entries with negative cidrlen.
They will be treated as hostmasks only. In the case of dlines they will be rejected as invalid. hostmask.c entries such as dlines, klines and auth blocks can only be added by opers or via ircd.conf.
This commit is contained in:
parent
441da2f245
commit
4e4a5fcc61
1 changed files with 4 additions and 0 deletions
|
@ -78,6 +78,8 @@ parse_netmask(const char *text, struct sockaddr *naddr, int *nb)
|
|||
*b = atoi(ptr);
|
||||
if(*b > 128)
|
||||
*b = 128;
|
||||
else if(*b < 0)
|
||||
return HM_HOST;
|
||||
} else
|
||||
*b = 128;
|
||||
if(rb_inet_pton_sock(ip, (struct sockaddr *)addr) > 0)
|
||||
|
@ -95,6 +97,8 @@ parse_netmask(const char *text, struct sockaddr *naddr, int *nb)
|
|||
*b = atoi(ptr);
|
||||
if(*b > 32)
|
||||
*b = 32;
|
||||
else if(*b < 0)
|
||||
return HM_HOST;
|
||||
} else
|
||||
*b = 32;
|
||||
if(rb_inet_pton_sock(ip, (struct sockaddr *)addr) > 0)
|
||||
|
|
Loading…
Reference in a new issue