Snort mailing list archives

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


From: Russ Combs <rcombs () sourcefire com>
Date: Mon, 9 Aug 2010 17:25:22 -0400

Opened a bug.  Thanks

On Tue, Aug 3, 2010 at 6:49 AM, Florian Westphal <fwestphal () astaro com>wrote:

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



------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Snort-devel mailing list
Snort-devel () lists sourceforge net
https://lists.sourceforge.net/lists/listinfo/snort-devel

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Snort-devel mailing list
Snort-devel () lists sourceforge net
https://lists.sourceforge.net/lists/listinfo/snort-devel

Current thread: