From 71bab65496099937477463a753ecc540c73780fe Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Mon, 5 Jun 2023 11:26:37 +0200 Subject: [PATCH] detect/files: reuse AppLayerParserSupportsFiles rather than relisting the protocols --- src/detect-file-data.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/detect-file-data.c b/src/detect-file-data.c index 7b1d06f622..546e046c24 100644 --- a/src/detect-file-data.c +++ b/src/detect-file-data.c @@ -197,11 +197,8 @@ static int DetectFiledataSetup (DetectEngineCtx *de_ctx, Signature *s, const cha SCEnter(); if (!DetectProtoContainsProto(&s->proto, IPPROTO_TCP) || - (s->alproto != ALPROTO_UNKNOWN && s->alproto != ALPROTO_HTTP1 && - s->alproto != ALPROTO_SMTP && s->alproto != ALPROTO_SMB && - s->alproto != ALPROTO_HTTP2 && s->alproto != ALPROTO_FTP && - s->alproto != ALPROTO_FTPDATA && s->alproto != ALPROTO_HTTP && - s->alproto != ALPROTO_NFS)) { + (s->alproto != ALPROTO_UNKNOWN && + !AppLayerParserSupportsFiles(IPPROTO_TCP, s->alproto))) { SCLogError("rule contains conflicting keywords."); return -1; }