]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stream: fix stream.inline default 1915/head
authorVictor Julien <victor@inliniac.net>
Wed, 9 Mar 2016 12:21:45 +0000 (13:21 +0100)
committerVictor Julien <victor@inliniac.net>
Wed, 9 Mar 2016 12:24:45 +0000 (13:24 +0100)
If stream.inline setting was missing it would default to IDS.

This patch changes the default to 'auto', meaning that in IPS mode
the stream engine also uses IPS mode and in IDS mode it's still in
IDS mode.

Bug #1570

src/stream-tcp.c

index 80d1b8dffde4f5652a614b49bb5d5d7c677f0244..9ccb6a2940eb4ca063aa16863b89c015560e67e6 100644 (file)
@@ -422,11 +422,10 @@ void StreamTcpInitConfig(char quiet)
                 "enabled" : "disabled");
     }
 
-    int inl = 0;
-
-
     char *temp_stream_inline_str;
     if (ConfGet("stream.inline", &temp_stream_inline_str) == 1) {
+        int inl = 0;
+
         /* checking for "auto" and falling back to boolean to provide
          * backward compatibility */
         if (strcmp(temp_stream_inline_str, "auto") == 0) {
@@ -438,6 +437,13 @@ void StreamTcpInitConfig(char quiet)
         } else if (ConfGetBool("stream.inline", &inl) == 1) {
             stream_inline = inl;
         }
+    } else {
+        /* default to 'auto' */
+        if (EngineModeIsIPS()) {
+            stream_inline = 1;
+        } else {
+            stream_inline = 0;
+        }
     }
 
     if (!quiet) {