From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: Question about nfnl_handle_packet/nfnl_process error handling
Date: Thu, 16 Feb 2012 18:41:42 +0100 [thread overview]
Message-ID: <20120216174142.GA5591@1984> (raw)
In-Reply-To: <20120216141546.GC11798@Chamillionaire.breakpoint.cc>
Hi Florian,
On Thu, Feb 16, 2012 at 03:15:46PM +0100, Florian Westphal wrote:
> libnetfilter_queue has:
>
> int nfq_handle_packet(struct nfq_handle *h, char *buf, int len)
> {
> return nfnl_handle_packet(h->nfnlh, buf, len);
> }
>
> When an error occurs, for example because a verdict for a bogus packet id was
> sent, nfq_handle_packet/nfnl_handle_packet returns -1 with errno == 0.
>
> Using nfnl_process() instead of nfq_handle_packet() sets errno to the expected
> ENOENT.
>
> Does anyone know if nfq_handle_packet() "errno 0" behaviour is intentional?
The initial libnfnetlink API did not set errno, nfnl_handle_packet is
part of that old API.
nfnl_process was added later to try to resolve some limitations by
2006 IIRC.
libmnl provide a neat new API. We have to move to it.
> Should I just ignore nfq_handle_packet() return value?
> What about deprecating nfnl_handle_packet() and using nfnl_process()
> instead?
I have ported libnetfilter_queue to libmnl, I need some spare time to
push the new API to the repository. I'll be happy if you spend some
time looking at it to find some possible issues, the idea is that the
new API resolves the existing API limitations.
next prev parent reply other threads:[~2012-02-16 17:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-16 14:15 Question about nfnl_handle_packet/nfnl_process error handling Florian Westphal
2012-02-16 17:41 ` Pablo Neira Ayuso [this message]
2012-02-16 21:41 ` Florian Westphal
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=20120216174142.GA5591@1984 \
--to=pablo@netfilter.org \
--cc=fw@strlen.de \
--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.