All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Leblond <eric@inl.fr>
To: Mistick Levi <gmistick@gmail.com>
Cc: "netfilter-devel@vger.kernel.org" <netfilter-devel@vger.kernel.org>
Subject: Re: libnetfilter_queue - remove packet from kernel buffer, and   reinject later
Date: Thu, 21 Jan 2010 08:08:42 +0100	[thread overview]
Message-ID: <1264057722.4571.48.camel@ice-age> (raw)
In-Reply-To: <6c279bde1001201213h724a22cfvc9c8e51538156ec2@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1509 bytes --]

Hello,

Le mercredi 20 janvier 2010 à 22:13 +0200, Mistick Levi a écrit :
> 2010/1/20 Eric Leblond <eric@inl.fr>:
> > Hello,
> >
> > Le mardi 19 janvier 2010 à 21:25 +0200, Mistick Levi a écrit :
> >> Hi,
> >> I've worked with libipq, and libnetfilter_queue, and i got to a place
> >> where my userspace code can't get anymore packets( with the message:
> >> netlink message: no buffer space available ) .
> >>
> >> Now what i want to do is this:
> >> Read a packet from the queue, copy it to my own queue/location in my
> >> program, and re injecting the packet later on with my verdict, after i
> >> finished.
> >
> > This is how it works ;)
> >
> > In fact, the 'no buffer space available' message is due to your program
> > not getting packets as fast as needed: The kernel is sending packet to a
> > netlink socket and the internal buffer of the socket gets filled with
> > the packets waiting to be read.
> >
> > What you need to do is:
> >      * read packet as fast as you can (your callback function has to be
> >        fast)
> >      * do the intensive or delay needing work outside of the callback
> >        (via a thread or something)
> 
> What do you mean by doing the delay needing work outside of the
> callback? in the end of the callback i should give a verdict, no ?

No, this is not necessary. The verdict can be called from anywhere else
in your program.

BR,


-- 
Eric Leblond <eric@inl.fr>
INL: http://www.inl.fr/
NuFW: http://www.nufw.org/

[-- Attachment #2: Ceci est une partie de message numériquement signée --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

      reply	other threads:[~2010-01-21  7:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-19 19:25 libnetfilter_queue - remove packet from kernel buffer, and reinject later Mistick Levi
2010-01-19 22:54 ` Eric Leblond
2010-01-20 20:13   ` Mistick Levi
2010-01-21  7:08     ` Eric Leblond [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1264057722.4571.48.camel@ice-age \
    --to=eric@inl.fr \
    --cc=gmistick@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.