| 56 |
|
{ |
| 57 |
|
if (tkline_time) |
| 58 |
|
{ |
| 59 |
< |
conf->hold = CurrentTime + tkline_time; |
| 59 |
> |
conf->until = CurrentTime + tkline_time; |
| 60 |
|
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
| 61 |
|
"%s added temporary %d min. D-Line for [%s] [%s]", |
| 62 |
|
get_oper_name(source_p), tkline_time/60, |
| 96 |
|
{ |
| 97 |
|
struct irc_ssaddr iphost, *piphost; |
| 98 |
|
struct MaskItem *conf; |
| 99 |
< |
int t; |
| 99 |
> |
int t = 0; |
| 100 |
> |
int aftype = 0; |
| 101 |
|
|
| 102 |
|
if ((t = parse_netmask(host, &iphost, NULL)) != HM_HOST) |
| 103 |
|
{ |
| 104 |
|
#ifdef IPV6 |
| 105 |
|
if (t == HM_IPV6) |
| 106 |
< |
t = AF_INET6; |
| 106 |
> |
aftype = AF_INET6; |
| 107 |
|
else |
| 108 |
|
#endif |
| 109 |
< |
t = AF_INET; |
| 109 |
> |
aftype = AF_INET; |
| 110 |
|
piphost = &iphost; |
| 111 |
|
} |
| 112 |
|
else |
| 112 |
– |
{ |
| 113 |
– |
t = 0; |
| 113 |
|
piphost = NULL; |
| 115 |
– |
} |
| 114 |
|
|
| 115 |
< |
if ((conf = find_conf_by_address(host, piphost, CONF_DLINE, t, NULL, NULL, 0))) |
| 115 |
> |
if ((conf = find_conf_by_address(host, piphost, CONF_DLINE, aftype, NULL, NULL, 0))) |
| 116 |
|
{ |
| 117 |
|
if (IsConfDatabase(conf)) |
| 118 |
|
{ |
| 146 |
|
struct irc_ssaddr daddr; |
| 147 |
|
struct MaskItem *conf=NULL; |
| 148 |
|
time_t tkline_time=0; |
| 149 |
< |
int bits, t; |
| 149 |
> |
int bits = 0, aftype = 0, t = 0; |
| 150 |
|
const char *current_date = NULL; |
| 151 |
|
time_t cur_time; |
| 152 |
|
char hostip[HOSTIPLEN + 1]; |
| 229 |
|
|
| 230 |
|
#ifdef IPV6 |
| 231 |
|
if (t == HM_IPV6) |
| 232 |
< |
t = AF_INET6; |
| 232 |
> |
aftype = AF_INET6; |
| 233 |
|
else |
| 234 |
|
#endif |
| 235 |
< |
t = AF_INET; |
| 235 |
> |
aftype = AF_INET; |
| 236 |
|
|
| 237 |
|
parse_netmask(dlhost, &daddr, NULL); |
| 238 |
|
|
| 239 |
< |
if ((conf = find_dline_conf(&daddr, t)) != NULL) |
| 239 |
> |
if ((conf = find_dline_conf(&daddr, aftype)) != NULL) |
| 240 |
|
{ |
| 241 |
|
creason = conf->reason ? conf->reason : def_reason; |
| 242 |
|
if (IsConfExemptKline(conf)) |
| 257 |
|
return; |
| 258 |
|
|
| 259 |
|
conf = conf_make(CONF_DLINE); |
| 260 |
< |
DupString(conf->host, dlhost); |
| 260 |
> |
conf->host = xstrdup(dlhost); |
| 261 |
|
|
| 262 |
|
if (tkline_time != 0) |
| 263 |
|
snprintf(buffer, sizeof(buffer), "Temporary D-line %d min. - %s (%s)", |
| 265 |
|
else |
| 266 |
|
snprintf(buffer, sizeof(buffer), "%s (%s)", reason, current_date); |
| 267 |
|
|
| 268 |
< |
DupString(conf->reason, buffer); |
| 268 |
> |
conf->reason = xstrdup(buffer); |
| 269 |
|
apply_dline(source_p, conf, tkline_time); |
| 270 |
|
rehashed_klines = 1; |
| 271 |
|
} |
| 281 |
|
struct irc_ssaddr daddr; |
| 282 |
|
struct MaskItem *conf=NULL; |
| 283 |
|
time_t tkline_time=0; |
| 284 |
< |
int bits, t; |
| 284 |
> |
int bits = 0, aftype = 0, t = 0; |
| 285 |
|
const char *current_date = NULL; |
| 286 |
|
time_t cur_time; |
| 287 |
|
char hostip[HOSTIPLEN + 1]; |
| 348 |
|
|
| 349 |
|
#ifdef IPV6 |
| 350 |
|
if (t == HM_IPV6) |
| 351 |
< |
t = AF_INET6; |
| 351 |
> |
aftype= AF_INET6; |
| 352 |
|
else |
| 353 |
|
#endif |
| 354 |
< |
t = AF_INET; |
| 354 |
> |
aftype = AF_INET; |
| 355 |
|
|
| 356 |
|
parse_netmask(dlhost, &daddr, NULL); |
| 357 |
|
|
| 358 |
< |
if ((conf = find_dline_conf(&daddr, t)) != NULL) |
| 358 |
> |
if ((conf = find_dline_conf(&daddr, aftype)) != NULL) |
| 359 |
|
{ |
| 360 |
|
creason = conf->reason ? conf->reason : def_reason; |
| 361 |
|
if (IsConfExemptKline(conf)) |
| 376 |
|
return; |
| 377 |
|
|
| 378 |
|
conf = conf_make(CONF_DLINE); |
| 379 |
< |
DupString(conf->host, dlhost); |
| 379 |
> |
conf->host = xstrdup(dlhost); |
| 380 |
|
|
| 381 |
|
if (tkline_time != 0) |
| 382 |
|
snprintf(buffer, sizeof(buffer), "Temporary D-line %d min. - %s (%s)", |
| 384 |
|
else |
| 385 |
|
snprintf(buffer, sizeof(buffer), "%s (%s)", reason, current_date); |
| 386 |
|
|
| 387 |
< |
DupString(conf->reason, buffer); |
| 387 |
> |
conf->reason = xstrdup(buffer); |
| 388 |
|
apply_dline(source_p, conf, tkline_time); |
| 389 |
|
rehashed_klines = 1; |
| 390 |
|
} |