From: Victor Julien Date: Thu, 15 Dec 2016 16:09:46 +0000 (+0100) Subject: flowvar: remove unused DETECT_VAR_TYPE_ALWAYS X-Git-Tag: suricata-4.0.0-beta1~316 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0af133c5f7c75b5c9abcc397527c45b2e032dad;p=thirdparty%2Fsuricata.git flowvar: remove unused DETECT_VAR_TYPE_ALWAYS --- diff --git a/src/detect-flowvar.c b/src/detect-flowvar.c index 9f84811a12..920ecf6510 100644 --- a/src/detect-flowvar.c +++ b/src/detect-flowvar.c @@ -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); diff --git a/src/detect.h b/src/detect.h index 023b931da4..acebc9f4ff 100644 --- a/src/detect.h +++ b/src/detect.h @@ -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 */