From 1b5e4011663c19ac09defe5b22087fe688862b0a Mon Sep 17 00:00:00 2001 From: "Russ Combs (rucombs)" Date: Sun, 1 Nov 2015 11:56:19 -0500 Subject: [PATCH] Merge pull request #112 in SNORT/snort3 from stream_warnings_patch to master Squashed commit of the following: commit 0881d5acce7594ed3fe56b36a2c6e6d7c360c513 Author: davis mcpherson Date: Fri Oct 30 14:51:32 2015 -0400 only build unit test specific files when unit tests are enabled commit ce554463c12976562abfb640288f4995269b8896 Author: davis mcpherson Date: Fri Oct 30 14:37:43 2015 -0400 fix configure & compiler warnings --- src/stream/Makefile.am | 1 + src/stream/libtcp/CMakeLists.txt | 7 ++++++- src/stream/libtcp/Makefile.am | 7 ++++++- src/stream/tcp/Makefile.am | 1 - src/stream/tcp/tcp_normalizers.cc | 4 ++++ 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/stream/Makefile.am b/src/stream/Makefile.am index 162784356..89cd8e461 100644 --- a/src/stream/Makefile.am +++ b/src/stream/Makefile.am @@ -11,6 +11,7 @@ stream_splitter.h libstream_a_SOURCES = \ flush_bucket.cc \ flush_bucket.h \ +paf.cc \ stream.h \ stream_api.cc \ stream_inspectors.cc \ diff --git a/src/stream/libtcp/CMakeLists.txt b/src/stream/libtcp/CMakeLists.txt index c992491cd..82160d859 100644 --- a/src/stream/libtcp/CMakeLists.txt +++ b/src/stream/libtcp/CMakeLists.txt @@ -1,8 +1,13 @@ +if ( BUILD_UNIT_TESTS ) + set(TEST_FILES stream_tcp_unit_test.cc) +endif() + + add_library( stream_libtcp STATIC tcp_segment_descriptor.cc tcp_stream_tracker.cc tcp_state_handler.cc tcp_state_machine.cc - stream_tcp_unit_test.cc + ${TEST_FILES} ) diff --git a/src/stream/libtcp/Makefile.am b/src/stream/libtcp/Makefile.am index 98f3d5f30..9ac80388e 100644 --- a/src/stream/libtcp/Makefile.am +++ b/src/stream/libtcp/Makefile.am @@ -11,7 +11,12 @@ tcp_state_handler.h \ tcp_state_machine.cc \ tcp_state_machine.h \ tcp_segment_descriptor.cc \ -tcp_segment_descriptor.h \ +tcp_segment_descriptor.h + +if BUILD_UNIT_TESTS +libstream_libtcp_a_SOURCES += \ stream_tcp_unit_test.cc \ stream_tcp_unit_test.h +endif + diff --git a/src/stream/tcp/Makefile.am b/src/stream/tcp/Makefile.am index 869bbcf7e..3bfbd0480 100644 --- a/src/stream/tcp/Makefile.am +++ b/src/stream/tcp/Makefile.am @@ -2,7 +2,6 @@ noinst_LIBRARIES = libstream_tcp.a libstream_tcp_a_SOURCES = \ -../paf.cc \ stream_tcp.cc \ stream_tcp.h \ segment_overlap_editor.h \ diff --git a/src/stream/tcp/tcp_normalizers.cc b/src/stream/tcp/tcp_normalizers.cc index 2f5fc1e7a..ab315abe2 100644 --- a/src/stream/tcp/tcp_normalizers.cc +++ b/src/stream/tcp/tcp_normalizers.cc @@ -496,6 +496,10 @@ int TcpNormalizerVista::handle_repeated_syn( TcpDataBlock *tdb ) bool TcpNormalizerProxy::validate_rst( TcpDataBlock *tdb ) { +#ifndef DEBUG_MSGS + UNUSED( tdb ); +#endif + // FIXIT - will session->flow ever be null? i would think not, remove this check if possible if( session->flow ) { -- 2.47.3