From 77e548ed1c3cfaa384b498e054e52d054e0e2b40 Mon Sep 17 00:00:00 2001 From: Andreas Herz Date: Thu, 14 Dec 2017 00:59:30 +0100 Subject: [PATCH] rule-reload: fix possible hangup with SIGUSR2 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 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/suricata.c b/src/suricata.c index 2e30bc03f0..50690df9c7 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -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!"); - } } /**