Re: [PATCH RFC netfilter-next 1/3] netfilter: introduce accessor functions for hook entries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> 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@xxxxxxxxxx>
>> ---
>>  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!
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux