From: Victor Julien Date: Tue, 18 Jan 2022 13:52:13 +0000 (+0100) Subject: proto-detect: fix UDP not setting alproto_ts/tc X-Git-Tag: suricata-7.0.0-beta1~1017 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=449cc82943f434f43987203db9448e431f9efd09;p=thirdparty%2Fsuricata.git proto-detect: fix UDP not setting alproto_ts/tc This would lead to the `app-layer-protocol` keyword not matching correctly. --- diff --git a/src/app-layer.c b/src/app-layer.c index 073a693fb2..0996c16436 100644 --- a/src/app-layer.c +++ b/src/app-layer.c @@ -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);