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

Russ Combs rcombs at ...402...
Mon Aug 9 17:25:22 EDT 2010


Opened a bug.  Thanks

On Tue, Aug 3, 2010 at 6:49 AM, Florian Westphal <fwestphal at ...2119...>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 at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/snort-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.snort.org/pipermail/snort-devel/attachments/20100809/54b206bd/attachment.html>


More information about the Snort-devel mailing list