-/* Copyright (C) 2007-2013 Open Information Security Foundation
+/* Copyright (C) 2007-2020 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
SigMatch *tmpm = NULL;
/* checks if there is a previous instance of detection_filter */
- tmpm = DetectGetLastSMFromLists(s, DETECT_DETECTION_FILTER, -1);
+ tmpm = DetectGetLastSMFromLists(s, DETECT_THRESHOLD, DETECT_DETECTION_FILTER, -1);
if (tmpm != NULL) {
- SCLogError(SC_ERR_INVALID_SIGNATURE, "\"detection_filter\" and "
- "\"threshold\" are not allowed in the same rule");
+ if (tmpm->type == DETECT_DETECTION_FILTER) {
+ SCLogError(SC_ERR_INVALID_SIGNATURE, "\"detection_filter\" and "
+ "\"threshold\" are not allowed in the same rule");
+ } else {
+ SCLogError(SC_ERR_INVALID_SIGNATURE, "multiple \"threshold\" "
+ "options are not allowed in the same rule");
+ }
SCReturnInt(-1);
}