]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rule-reload: fix possible hangup with SIGUSR2
authorAndreas Herz <andi@geekosphere.org>
Wed, 13 Dec 2017 23:59:30 +0000 (00:59 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 14 Dec 2017 18:03:07 +0000 (19:03 +0100)
In some cases the rule reload could hang. The pending USR2 signals will
be recognized even with the <2 check. Also the SCLogWarning shouldn't be
used in the handler (see Warning about SCLog* API above in the code).

src/suricata.c

index 2e30bc03f0bf916b4f59c3bfb25c2c57270723d0..50690df9c75e12440c77fbb734563679a3b3c874 100644 (file)
@@ -293,11 +293,8 @@ static void SignalHandlerSigterm(/*@unused@*/ int sig)
  */
 static void SignalHandlerSigusr2(int sig)
 {
-    if (sigusr2_count < 16) {
+    if (sigusr2_count < 2)
         sigusr2_count++;
-    } else {
-        SCLogWarning(SC_ERR_LIVE_RULE_SWAP, "Too many USR2 signals pending, ignoring new ones!");
-    }
 }
 
 /**