From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: netdev@vger.kernel.org, netfilter-devel@vger.kernel.org,
davem@davemloft.net
Subject: Re: [PATCH 1/3] netlink: add netlink_dump_control structure for netlink_dump_start()
Date: Sat, 25 Feb 2012 14:22:44 +0100 [thread overview]
Message-ID: <20120225132244.GB15774@1984> (raw)
In-Reply-To: <alpine.LNX.2.01.1202250210240.17151@frira.zrqbmnf.qr>
On Sat, Feb 25, 2012 at 02:12:22AM +0100, Jan Engelhardt wrote:
> On Saturday 2012-02-25 01:30, pablo@netfilter.org wrote:
>
> >From: Pablo Neira Ayuso <pablo@netfilter.org>
> >
> >Davem considers that the argument list of this interface is getting
> >out of control. This patch tries to address this issue following
> >his proposal:
> >
> >struct netlink_dump_control c = { .dump = dump, .done = done, ... };
> >
> >netlink_dump_start(..., &c);
>
> What about adding skb and nlh into c as well? After all, skb
> is not nearly as much {used directly} as it is in Xtables.
If you look at all netlink_dump_start invocations. Those are always
included. The idea was to add to the structure fields that may be
unset.
> >+ {
> >+ struct netlink_dump_control c = {
> >+ .dump = link->dump,
> >+ .done = link->done,
> >+ };
> >+ return netlink_dump_start(crypto_nlsk, skb, nlh, &c);
> >+ }
>
> You can also use
>
> return netlink_dump_start(crypto_nlsk, skb,
> &(const struct netlink_dump_control)
> {.dump = link->dump, .done = link->done}));
Nice to know, thanks. Haven't see this in any other part of the kernel
code though and it looks a bit ugly IMO. I think I prefer the way it is
now.
next prev parent reply other threads:[~2012-02-25 13:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-25 0:30 [PATCH 0/3] netlink: netlink_dump_start takes pointer to data pablo
2012-02-25 0:30 ` [PATCH 1/3] netlink: add netlink_dump_control structure for netlink_dump_start() pablo
2012-02-25 1:12 ` Jan Engelhardt
2012-02-25 13:22 ` Pablo Neira Ayuso [this message]
2012-02-26 19:26 ` David Miller
2012-02-25 0:30 ` [PATCH 2/3] netlink: allow to pass data pointer to netlink_dump_start() callback pablo
2012-02-26 19:27 ` David Miller
2012-02-25 0:30 ` [PATCH 3/3] netfilter: ctnetlink: support kernel-space dump filtering by ctmark pablo
2012-02-25 0:41 ` Pablo Neira Ayuso
2012-02-26 19:27 ` David Miller
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=20120225132244.GB15774@1984 \
--to=pablo@netfilter.org \
--cc=davem@davemloft.net \
--cc=jengelh@medozas.de \
--cc=netdev@vger.kernel.org \
--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).