From: Yuki Inoguchi Date: Thu, 6 Oct 2016 09:44:51 +0000 (+0900) Subject: journald, ratelimit: fix inaccurate message suppression in journal_rate_limit_test... X-Git-Tag: v232~148 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2665e0866772663ad7c774c05bf2e0dc8ddcb04;p=thirdparty%2Fsystemd.git journald, ratelimit: fix inaccurate message suppression in journal_rate_limit_test() (#4291) Currently, the ratelimit does not handle the number of suppressed messages accurately. Even though the number of messages reaches the limit, it still allows to add one extra messages to journal. This patch fixes the problem. --- diff --git a/src/journal/journald-rate-limit.c b/src/journal/journald-rate-limit.c index d30bf92cec6..f48639cf58c 100644 --- a/src/journal/journald-rate-limit.c +++ b/src/journal/journald-rate-limit.c @@ -261,7 +261,7 @@ int journal_rate_limit_test(JournalRateLimit *r, const char *id, int priority, u return 1 + s; } - if (p->num <= burst) { + if (p->num < burst) { p->num++; return 1; }