Blame SOURCES/rsyslog-8.2102.0-rhbz1984616-imuxsock-ratelimit.patch

000b35
diff -up rsyslog-8.2102.0/runtime/ratelimit.c.orig rsyslog-8.2102.0/runtime/ratelimit.c
000b35
--- rsyslog-8.2102.0/runtime/ratelimit.c.orig	2021-07-27 10:37:50.972903104 +0200
000b35
+++ rsyslog-8.2102.0/runtime/ratelimit.c	2021-07-27 10:38:26.141002988 +0200
000b35
@@ -235,7 +235,6 @@ ratelimitMsg(ratelimit_t *__restrict__ c
000b35
 {
000b35
 	DEFiRet;
000b35
 	rsRetVal localRet;
000b35
-	int severity = 0;
000b35
 
000b35
 	*ppRepMsg = NULL;
000b35
 
000b35
@@ -246,13 +245,12 @@ ratelimitMsg(ratelimit_t *__restrict__ c
000b35
 				DBGPRINTF("Message discarded, parsing error %d\n", localRet);
000b35
 				ABORT_FINALIZE(RS_RET_DISCARDMSG);
000b35
 			}
000b35
-			severity = pMsg->iSeverity;
000b35
 		}
000b35
 	}
000b35
 
000b35
 	/* Only the messages having severity level at or below the
000b35
 	 * treshold (the value is >=) are subject to ratelimiting. */
000b35
-	if(ratelimit->interval && (severity >= ratelimit->severity)) {
000b35
+	if(ratelimit->interval && (pMsg->iSeverity >= ratelimit->severity)) {
000b35
 		char namebuf[512]; /* 256 for FGDN adn 256 for APPNAME should be enough */
000b35
 		snprintf(namebuf, sizeof namebuf, "%s:%s", getHOSTNAME(pMsg),
000b35
 			getAPPNAME(pMsg, 0));