[Snort-devel] [DAQ][PATCH 2/3] nfq: fix _acquire return value on select EINTR error

Florian Westphal fwestphal at ...2119...
Tue Aug 3 06:49:31 EDT 2010


snort will exit when DAQ_Acquire() signals an error.
snorts PacketLoop() will check for pending signals when
DAQ_Acquire returns zero, which is exactly what we should do
upon EINTR.
---
 os-daq-modules/daq_nfq.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/os-daq-modules/daq_nfq.c b/os-daq-modules/daq_nfq.c
index 2a0360b..2c033d4 100644
--- a/os-daq-modules/daq_nfq.c
+++ b/os-daq-modules/daq_nfq.c
@@ -447,8 +447,9 @@ static int nfq_daq_acquire (
         // at least ipq had a timeout!
         if ( select(impl->sock+1, &fdset, NULL, NULL, &tv) < 0 )
         {
-            if ( errno != EINTR )
-                DPE(impl->error, "%s: select = %s",
+            if ( errno == EINTR )
+                break;
+            DPE(impl->error, "%s: select = %s",
                     __FUNCTION__, strerror(errno));
             return DAQ_ERROR;
         }
-- 
1.7.1





More information about the Snort-devel mailing list