]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
proto-detect: fix UDP not setting alproto_ts/tc
authorVictor Julien <vjulien@oisf.net>
Tue, 18 Jan 2022 13:52:13 +0000 (14:52 +0100)
committerVictor Julien <vjulien@oisf.net>
Tue, 18 Jan 2022 13:52:17 +0000 (14:52 +0100)
This would lead to the `app-layer-protocol` keyword not matching correctly.

src/app-layer.c

index 073a693fb2300020feaed70e71913eedc463a3f6..0996c164366cd136674327e9e636ec00820a9fbe 100644 (file)
@@ -769,6 +769,12 @@ int AppLayerHandleUdp(ThreadVars *tv, AppLayerThreadCtx *tctx, Packet *p, Flow *
         if (f->alproto != ALPROTO_UNKNOWN) {
             AppLayerIncFlowCounter(tv, f);
 
+            if (p->flowflags & FLOW_PKT_TOSERVER) {
+                f->alproto_ts = f->alproto;
+            } else {
+                f->alproto_tc = f->alproto;
+            }
+
             if (reverse_flow) {
                 SCLogDebug("reversing flow after proto detect told us so");
                 PacketSwap(p);