blocklist.c (sshguard-2.4.1) | : | blocklist.c (sshguard-2.4.2) | ||
---|---|---|---|---|
skipping to change at line 60 | skipping to change at line 60 | |||
pthread_mutex_lock(&list_mutex); | pthread_mutex_lock(&list_mutex); | |||
for (unsigned int pos = 0; pos < list_size(&hell); pos++) { | for (unsigned int pos = 0; pos < list_size(&hell); pos++) { | |||
tmpel = list_get_at(&hell, pos); | tmpel = list_get_at(&hell, pos); | |||
/* skip blacklisted hosts (pardontime = infinite/0) */ | /* skip blacklisted hosts (pardontime = infinite/0) */ | |||
if (tmpel->pardontime == 0) | if (tmpel->pardontime == 0) | |||
continue; | continue; | |||
/* process hosts with finite pardon time */ | /* process hosts with finite pardon time */ | |||
if (now - tmpel->whenlast > tmpel->pardontime) { | if (now - tmpel->whenlast > tmpel->pardontime) { | |||
/* pardon time passed, release block */ | /* pardon time passed, release block */ | |||
sshguard_log(LOG_DEBUG, "%s: unblocking after %lld secs", | sshguard_log(LOG_INFO, "%s: unblocking after %lld secs", | |||
tmpel->attack.address.value, | tmpel->attack.address.value, | |||
(long long)(now - tmpel->whenlast)); | (long long)(now - tmpel->whenlast)); | |||
fw_release(&tmpel->attack); | fw_release(&tmpel->attack); | |||
list_delete_at(&hell, pos); | list_delete_at(&hell, pos); | |||
free(tmpel); | free(tmpel); | |||
/* element removed, next element is at current index (don't step | /* element removed, next element is at current index (don't step | |||
* pos) */ | * pos) */ | |||
pos--; | pos--; | |||
} | } | |||
} | } | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |