]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
flowvar: remove unused DETECT_VAR_TYPE_ALWAYS
authorVictor Julien <victor@inliniac.net>
Thu, 15 Dec 2016 16:09:46 +0000 (17:09 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 16 Feb 2017 09:35:44 +0000 (10:35 +0100)
src/detect-flowvar.c
src/detect.h

index 9f84811a12bd760af71b88f187654f17068db65a..920ecf6510935cf5665de6da0cc76ece961dab99 100644 (file)
@@ -339,10 +339,9 @@ static int DetectFlowvarPostMatch(ThreadVars *tv,
     return 1;
 }
 
-/** \brief Handle flowvar candidate list in det_ctx:
- *         - clean up the list
- *         - enforce storage for type ALWAYS (vars set from lua)
- *   Only called from DetectFlowvarProcessList() when flowvarlist is not NULL .
+/** \brief Handle flowvar candidate list in det_ctx: clean up the list
+ *
+ *   Only called from DetectVarProcessList() when varlist is not NULL.
  */
 void DetectVarProcessListInternal(DetectVarList *fs, Flow *f, Packet *p)
 {
@@ -351,16 +350,10 @@ void DetectVarProcessListInternal(DetectVarList *fs, Flow *f, Packet *p)
     do {
         next = fs->next;
 
-        if (fs->type == DETECT_VAR_TYPE_ALWAYS) {
-            SCLogDebug("adding to the flow %u:", fs->idx);
-            //PrintRawDataFp(stdout, fs->buffer, fs->len);
-
-            FlowVarAddStrNoLock(f, fs->idx, fs->buffer, fs->len);
-            /* memory at fs->buffer is now the responsibility of
-             * the flowvar code. */
-        } else {
-            SCFree(fs->buffer);
+        if (fs->key) {
+            SCFree(fs->key);
         }
+        SCFree(fs->buffer);
         SCFree(fs);
         fs = next;
     } while (fs != NULL);
index 023b931da41e3ce0dab1197bd9452434deab38cd..acebc9f4ffe05cbe3c1583adef79e83c43031d67 100644 (file)
@@ -492,8 +492,6 @@ typedef struct DetectReplaceList_ {
 /** only execute flowvar storage if rule matched */
 #define DETECT_VAR_TYPE_FLOW_POSTMATCH      1
 #define DETECT_VAR_TYPE_PKT_POSTMATCH       2
-/** execute flowvar storage even if rule doesn't match (for lua) */
-#define DETECT_VAR_TYPE_ALWAYS              3
 
 /** list for flowvar store candidates, to be stored from
  *  post-match function */