]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
filestore: don't assume flow is TCP 4350/head 4370/head
authorVictor Julien <victor@inliniac.net>
Thu, 24 Oct 2019 12:51:48 +0000 (14:51 +0200)
committerVictor Julien <victor@inliniac.net>
Sat, 2 Nov 2019 15:41:22 +0000 (16:41 +0100)
Filestore can be used by UDP based protocols as well. NFSv2 is one
that Suricata supports.

Bug #3278.

(cherry picked from commit 0824b0413455b668777e83cabe9fbc0ea81c400a)

src/detect-filestore.c

index b001537cb57dca805041ca591ca1ed7ad5a36375..b9c3f7692c65d312c0e841adb4df4f76793369f2 100644 (file)
@@ -202,10 +202,11 @@ int DetectFilestorePostMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Pack
 #endif
     }
 
-    /* set filestore depth for stream reassembling */
-    TcpSession *ssn = (TcpSession *)p->flow->protoctx;
-    TcpSessionSetReassemblyDepth(ssn, FileReassemblyDepth());
-
+    if (p->proto == IPPROTO_TCP && p->flow->protoctx != NULL) {
+        /* set filestore depth for stream reassembling */
+        TcpSession *ssn = (TcpSession *)p->flow->protoctx;
+        TcpSessionSetReassemblyDepth(ssn, FileReassemblyDepth());
+    }
     if (p->flowflags & FLOW_PKT_TOCLIENT)
         flags |= STREAM_TOCLIENT;
     else