]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
fixed snort -n
authorRuss Combs <rucombs@cisco.com>
Thu, 19 Jun 2014 02:52:43 +0000 (22:52 -0400)
committerRuss Combs <rucombs@cisco.com>
Thu, 19 Jun 2014 02:52:43 +0000 (22:52 -0400)
src/main/analyzer.cc
src/main/snort.cc

index 656eed3f29823a7715cff28fa50d457f7483f5d6..662af6b51f5d1234a3f14372e71e4012f229af56 100644 (file)
@@ -100,8 +100,6 @@ bool Analyzer::handle(AnalyzerCommand ac)
 
 void Analyzer::analyze()
 {
-    uint64_t max = snort_conf->pkt_cnt;
-
     while ( true )
     {
         if ( command )
@@ -116,11 +114,6 @@ void Analyzer::analyze()
         }
         if ( DAQ_Acquire(0, main_func, NULL) )
             break;
-
-        ++count;
-
-        if ( max && count >= max )
-            break;
     }
 }
 
index 99480ffc37cca392b429fbb6bb409690ac7620de..e77caff438cbfe1f70041a026ead365ac996a25a 100644 (file)
@@ -975,6 +975,9 @@ DAQ_Verdict packet_callback(
 
     s_packet.pkth = NULL;  // no longer avail on segv
 
+    if ( snort_conf->pkt_cnt && pc.total_from_daq >= snort_conf->pkt_cnt )
+        DAQ_BreakLoop(-1);
+
     PREPROC_PROFILE_END(totalPerfStats);
     return verdict;
 }