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])) |
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 |
{ |
{ |
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)) |