]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
smtp: improve handling of bad traffic
authorVictor Julien <victor@inliniac.net>
Mon, 30 Nov 2015 14:46:15 +0000 (15:46 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 7 Dec 2015 16:19:53 +0000 (17:19 +0100)
No longer fail tracking the SMTP stream when a unexpected reply is
encountered.

Do not store the unexpected reply.

src/app-layer-smtp.c

index cd0a732e1eb70fb2866bc5bfa7e1f3997ae7ec5b..61ac4ec645e69863d3f45a13c1b5dfe8bf1e08b9 100644 (file)
@@ -887,12 +887,14 @@ static int SMTPProcessReply(SMTPState *state, Flow *f,
                 state->parser_state |= SMTP_PARSER_STATE_FIRST_REPLY_SEEN;
             if (reply_code == SMTP_REPLY_220)
                 SCReturnInt(0);
-            else
+            else {
                 SMTPSetEvent(state, SMTP_DECODER_EVENT_INVALID_REPLY);
+                SCReturnInt(0);
+            }
         } else {
             /* decoder event - unable to match reply with request */
             SCLogDebug("unable to match reply with request");
-            SCReturnInt(-1);
+            SCReturnInt(0);
         }
     }