Skip to content

Commit

Permalink
printk: fix comment for printk ratelimiting
Browse files Browse the repository at this point in the history
The comment assumed the burst to be one and the ratelimit used to be named
printk_ratelimit_jiffies.

Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
Cc: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Uwe Kleine-König authored and Linus Torvalds committed Jul 30, 2008
1 parent 8f3d137 commit 641de9d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kernel/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1309,14 +1309,14 @@ void tty_write_message(struct tty_struct *tty, char *msg)

#if defined CONFIG_PRINTK

DEFINE_RATELIMIT_STATE(printk_ratelimit_state, 5 * HZ, 10);
/*
* printk rate limiting, lifted from the networking subsystem.
*
* This enforces a rate limit: not more than one kernel message
* every printk_ratelimit_jiffies to make a denial-of-service
* attack impossible.
* This enforces a rate limit: not more than 10 kernel messages
* every 5s to make a denial-of-service attack impossible.
*/
DEFINE_RATELIMIT_STATE(printk_ratelimit_state, 5 * HZ, 10);

int printk_ratelimit(void)
{
return __ratelimit(&printk_ratelimit_state);
Expand Down

0 comments on commit 641de9d

Please sign in to comment.