From: Aaron Conole <aconole@bytheb.org>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org, Florian Westphal <fw@strlen.de>
Subject: Re: [PATCH RFC netfilter-next 1/3] netfilter: introduce accessor functions for hook entries
Date: Thu, 03 Nov 2016 12:32:10 -0400 [thread overview]
Message-ID: <f7tshr8y16d.fsf@redhat.com> (raw)
In-Reply-To: <20161103161559.GA3362@salvia> (Pablo Neira Ayuso's message of "Thu, 3 Nov 2016 17:15:59 +0100")
Pablo Neira Ayuso <pablo@netfilter.org> writes:
> On Thu, Oct 27, 2016 at 02:27:51PM -0400, Aaron Conole wrote:
>> This allows easier future refactoring.
>>
>> Signed-off-by: Aaron Conole <aconole@bytheb.org>
>> ---
>> include/linux/netfilter.h | 35 ++++++++++++++++++++++++++++++++++-
>> net/bridge/br_netfilter_hooks.c | 2 +-
>> net/netfilter/core.c | 8 +++-----
>> net/netfilter/nf_queue.c | 8 ++++----
>> 4 files changed, 42 insertions(+), 11 deletions(-)
...
> I'd suggest something like:
>
> static inline int
> nf_entry_hookfn(const struct nf_hook_entry *entry,
> struct sk_buff *skb, struct nf_hook_state *state)
> {
> return entry->ops.hook(entry, nf_hook_entry_priv(entry), skb, state);
> }
>
> So you can avoid this:
>
> verdict = nf_hook_entry_hookfn(*entryp)
> (nf_hook_entry_priv(*entryp), skb, state);
Makes sense, I'll do that. Thanks for the review!
next prev parent reply other threads:[~2016-11-03 16:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-27 18:27 [PATCH RFC netfilter-next 0/3] Additional refactoring enhancements for nf_hook_entry Aaron Conole
2016-10-27 18:27 ` [PATCH RFC netfilter-next 1/3] netfilter: introduce accessor functions for hook entries Aaron Conole
2016-11-03 16:15 ` Pablo Neira Ayuso
2016-11-03 16:32 ` Aaron Conole [this message]
2016-10-27 18:27 ` [PATCH RFC netfilter-next 2/3] netfilter: decouple nf_hook_entry and nf_hook_ops Aaron Conole
2016-10-27 18:27 ` [PATCH RFC netfilter-next 3/3] netfilter: convert while loops to for loops Aaron Conole
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=f7tshr8y16d.fsf@redhat.com \
--to=aconole@bytheb.org \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.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.