char def[] = "No Reason";
const char *dlhost;
char *reason = def;
- char cidr_form_host[HOSTLEN + 1];
int tdline_time = 0;
const char *target_server = NULL;
int loc = 1;
if((tdline_time = valid_temp_time(parv[loc])) >= 0)
loc++;
+ if (loc >= parc)
+ {
+ sendto_one_notice(source_p, ":Need an IP to D-Line");
+ return;
+ }
+
dlhost = parv[loc];
- rb_strlcpy(cidr_form_host, dlhost, sizeof(cidr_form_host));
loc++;
/* would break the protocol */
if (*dlhost == ':')
{
- sendto_one_notice(source_p, ":Invalid D-Line");
+ sendto_one_notice(source_p, ":Invalid D-Line [%s] - IP cannot start with :", dlhost);
+ return;
+ }
+
+ int ty = parse_netmask_strict(dlhost, NULL, NULL);
+ if (ty != HM_IPV4 && ty != HM_IPV6)
+ {
+ sendto_one_notice(source_p, ":Invalid D-Line [%s] - doesn't look like IP[/cidr]", dlhost);
return;
}
char buf[BUFSIZE];
struct ConfItem *aconf;
- int masktype = parse_netmask_strict(cidr, NULL, NULL);
+ int masktype = parse_netmask(cidr, NULL, NULL);
if(masktype != HM_IPV4 && masktype != HM_IPV6)
{
- sendto_one_notice(source_p, ":Invalid D-Line");
+ sendto_one_notice(source_p, ":Invalid D-Line [%s] - doesn't look like IP[/cidr]", cidr);
return;
}