0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-18 08:28:40 +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:
Jilles Tjoelker 2013-01-29 23:43:20 +01:00
parent 441da2f245
commit 4e4a5fcc61

View file

@ -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)