From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Patrick McHardy <kaber@trash.net>
Cc: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>,
netfilter-devel@vger.kernel.org
Subject: Re: [nft RFC PATCH 6/6] src: add events reporting
Date: Tue, 18 Feb 2014 10:58:29 +0100 [thread overview]
Message-ID: <20140218095829.GA4173@localhost> (raw)
In-Reply-To: <20140218095209.GA12005@macbook.localnet>
On Tue, Feb 18, 2014 at 09:52:10AM +0000, Patrick McHardy wrote:
> On Tue, Feb 18, 2014 at 10:43:20AM +0100, Pablo Neira Ayuso wrote:
> > On Tue, Feb 18, 2014 at 09:33:11AM +0000, Patrick McHardy wrote:
> > > On Tue, Feb 18, 2014 at 10:28:11AM +0100, Pablo Neira Ayuso wrote:
> > > > On Tue, Feb 18, 2014 at 02:03:55AM +0000, Patrick McHardy wrote:
> > > > > On Tue, Feb 18, 2014 at 02:10:07AM +0100, Pablo Neira Ayuso wrote:
> > > > > > On Tue, Feb 18, 2014 at 12:18:38AM +0100, Arturo Borrero Gonzalez wrote:
> > > > > > > +static int netlink_events_table_cb(const struct nlmsghdr *nlh, int type,
> > > > > > > + struct netlink_ev_handler *evh)
> > > > > > > +{
> > > > > > > + struct nft_table *nlt;
> > > > > > > + uint32_t family;
> > > > > > > + char buf[4096];
> > > > > > > +
> > > > > > > + nlt = nft_table_alloc();
> > > > > > > + if (nlt == NULL)
> > > > > > > + memory_allocation_error();
> > > > > > > +
> > > > > > > + if (nft_table_nlmsg_parse(nlh, nlt) < 0) {
> > > > > > > + netlink_io_error(evh->ctx, evh->loc,
> > > > > > > + "Could not parse table: %s",
> > > > > > > + strerror(errno));
> > > > > >
> > > > > > I think you should exit on parsing errors.
> > > > >
> > > > > I'm not so sure for event reporting. We should abort reporting the current
> > > > > event, sure. But I don't see why we shouldn't continue listering for further
> > > > > events.
> > > >
> > > > I think if we fail to parse anything it means that there's some bug
> > > > that need to be fixed, eg. someone changed the length of an attribute
> > > > so validation fails. I think stopping there should help us to get
> > > > people reporting problems.
> > >
> > > Well, it depends on what exactly we couldn't parse or handle. Basic things
> > > like table names etc. can of course trigger a fatal error. But unknown
> > > expression types shouldn't cause an error.
> >
> > As i said, unknown netlink attributes are skipped.
> >
> > That function is not building *any* struct expr *, it's just
> > generating the libnftnl nft_table object that is used to obtain the
> > internal table object in a later stage. If it fails there's something
> > that need to be fixed in that code.
>
> Sure, just wanted to be clear about which types of errors may cause
> a fatal error.
Talking about errors when building the higher level expression tree
from the netlink message, I think nft should output some low-level
expression if it fails to interpret it in a human readable way / nft
syntax way.
We already discussed that third party applications may decide to skip
nft as use the netlink interface to build sophisticated filters, in
that case, I think those tools should not break the output of nft if
it fails to understand what it gets from the kernel.
next prev parent reply other threads:[~2014-02-18 9:58 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-17 23:18 [nft RFC PATCH 0/6] events Arturo Borrero Gonzalez
2014-02-17 23:18 ` [nft RFC PATCH 1/6] rule: make family2str() public Arturo Borrero Gonzalez
2014-02-18 1:01 ` Pablo Neira Ayuso
2014-02-17 23:18 ` [nft RFC PATCH 2/6] rule: allow to print sets in plain format Arturo Borrero Gonzalez
2014-02-18 1:54 ` Patrick McHardy
2014-02-17 23:18 ` [nft RFC PATCH 3/6] netlink: add netlink_delinearize_set() func Arturo Borrero Gonzalez
2014-02-18 1:56 ` Patrick McHardy
2014-02-18 9:11 ` Arturo Borrero Gonzalez
2014-02-18 9:21 ` Patrick McHardy
2014-02-17 23:18 ` [nft RFC PATCH 4/6] rule: generalize chain_print() Arturo Borrero Gonzalez
2014-02-17 23:18 ` [nft RFC PATCH 5/6] netlink: add netlink_delinearize_rule() func Arturo Borrero Gonzalez
2014-02-17 23:18 ` [nft RFC PATCH 6/6] src: add events reporting Arturo Borrero Gonzalez
2014-02-18 1:10 ` Pablo Neira Ayuso
2014-02-18 2:03 ` Patrick McHardy
2014-02-18 9:28 ` Pablo Neira Ayuso
2014-02-18 9:33 ` Patrick McHardy
2014-02-18 9:43 ` Pablo Neira Ayuso
2014-02-18 9:52 ` Patrick McHardy
2014-02-18 9:58 ` Pablo Neira Ayuso [this message]
2014-02-18 10:12 ` Patrick McHardy
2014-02-18 14:21 ` Arturo Borrero Gonzalez
2014-02-18 14:46 ` Patrick McHardy
2014-02-18 1:07 ` [nft RFC PATCH 0/6] events Pablo Neira Ayuso
2014-02-18 1:43 ` Patrick McHardy
2014-02-18 9:20 ` Arturo Borrero Gonzalez
2014-02-18 9:24 ` Patrick McHardy
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=20140218095829.GA4173@localhost \
--to=pablo@netfilter.org \
--cc=arturo.borrero.glez@gmail.com \
--cc=kaber@trash.net \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).