pknock: avoid fillup of peer table during DDoS

In TCP --strict mode, forget the peer which sent the wrong knock in a
sequence, rather than resetting its status to ST_INIT. This avoids
filling up the peer table (which would lead to pknock DoS) in case of
a DDoS attack performed by a set of port-scanning malicious hosts.
This commit is contained in:
Jan Rafaj
2009-10-11 00:05:17 +02:00
committed by Jan Engelhardt
parent 82a8524f1a
commit 08f6a82bdc

View File

@@ -841,7 +841,7 @@ update_peer(struct peer *peer, const struct xt_pknock_mtinfo *info,
pk_debug("DIDN'T MATCH", peer);
/* Peer must start the sequence from scratch. */
if (info->option & XT_PKNOCK_STRICT)
reset_knock_status(peer);
remove_peer(peer);
return false;
}