]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
event: only sets APPLAYER_UNEXPECTED_PROTOCOL once
authorPhilippe Antoine <contact@catenacyber.fr>
Wed, 1 Jun 2022 13:04:34 +0000 (15:04 +0200)
committerVictor Julien <vjulien@oisf.net>
Mon, 13 Jun 2022 05:59:41 +0000 (07:59 +0200)
If f->alproto == ALPROTO_UNKNOWN, we do not know the new protocol
yet, so we do not set the event yet.

src/app-layer.c

index bd1942e1278ef059254821facc01e74321e72124..e7ac4d2eb3f48ed110f17c3864cc1eb5a7938e7c 100644 (file)
@@ -737,9 +737,8 @@ int AppLayerHandleTCPData(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx,
         SCLogDebug("protocol change, old %s, new %s",
                 AppProtoToString(f->alproto_orig), AppProtoToString(f->alproto));
 
-        if (f->alproto_expect != ALPROTO_UNKNOWN &&
-                f->alproto != f->alproto_expect)
-        {
+        if (f->alproto_expect != ALPROTO_UNKNOWN && f->alproto != ALPROTO_UNKNOWN &&
+                f->alproto != f->alproto_expect) {
             AppLayerDecoderEventsSetEventRaw(&p->app_layer_events,
                                              APPLAYER_UNEXPECTED_PROTOCOL);