From 41ca4cac35ec0b1061450e61c50813eb462ef158 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Tue, 4 Oct 2011 00:13:53 +0200 Subject: [PATCH] Enforce the average allowed send rate is at least the one allowed by rfc1459. --- src/s_conf.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/s_conf.c b/src/s_conf.c index 8b963e13..6f4e3136 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -863,6 +863,14 @@ validate_conf(void) } + /* RFC 1459 says 1 message per 2 seconds on average is acceptable, + * so allow at least that. + */ + if(ConfigFileEntry.client_flood_message_time > + ConfigFileEntry.client_flood_message_num * 2) + ConfigFileEntry.client_flood_message_time = + ConfigFileEntry.client_flood_message_num * 2; + if((ConfigFileEntry.client_flood_max_lines < CLIENT_FLOOD_MIN) || (ConfigFileEntry.client_flood_max_lines > CLIENT_FLOOD_MAX)) ConfigFileEntry.client_flood_max_lines = CLIENT_FLOOD_MAX;