]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journald, ratelimit: fix inaccurate message suppression in journal_rate_limit_test...
authorYuki Inoguchi <inoguchi.yuki@jp.fujitsu.com>
Thu, 6 Oct 2016 09:44:51 +0000 (18:44 +0900)
committerLennart Poettering <lennart@poettering.net>
Thu, 6 Oct 2016 09:44:51 +0000 (11:44 +0200)
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.

src/journal/journald-rate-limit.c

index d30bf92cec64036c148a86f0ee01d1d195a876b2..f48639cf58c23960ce593e968493a0058adc811c 100644 (file)
@@ -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;
         }