Snort mailing list archives

Re: [PATCH 2/2] daq_nfq: avoid uneeded -ENOBUFS on queue overrun


From: Russ Combs <rcombs () sourcefire com>
Date: Fri, 29 Apr 2011 14:37:56 -0400

Thanks Florian.  I added this to an existing bug on error handling by the
NFQ DAQ which is targeted for the 2.9.1 release.

On Fri, Apr 29, 2011 at 8:36 AM, Florian Westphal <fwestphal () astaro com>wrote:

netlink signals event queue overflows by returning -ENOBUFS to
userspace.

daq_nfq does not need to care about this, so ignore ENOBUFS and tell
the kernel to not notify us in the first place.
---
 os-daq-modules/daq_nfq.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/os-daq-modules/daq_nfq.c b/os-daq-modules/daq_nfq.c
index d55e9d6..55ac811 100644
--- a/os-daq-modules/daq_nfq.c
+++ b/os-daq-modules/daq_nfq.c
@@ -338,6 +338,11 @@ static int nfq_daq_initialize (
        }
    }

+    // tell kernel that we do not need to know about queue overflows.
+    // Without this, read operations on the netlink socket will fail
+    // with ENOBUFS on queue overrun.
+    setsockopt(impl->sock, SOL_NETLINK, NETLINK_NO_ENOBUFS, &(int){1},
+                                                         sizeof(int));
    impl->state = DAQ_STATE_INITIALIZED;

    *handle = impl;
--
1.7.3.4



------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network
management toolset available today.  Delivers lowest initial
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Snort-devel mailing list
Snort-devel () lists sourceforge net
https://lists.sourceforge.net/lists/listinfo/snort-devel

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Snort-devel mailing list
Snort-devel () lists sourceforge net
https://lists.sourceforge.net/lists/listinfo/snort-devel

Current thread: