netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Edward Cree <ecree@solarflare.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>, Florian Westphal <fw@strlen.de>
Cc: <netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH v2 nf-next] netfilter: add and use nf_hook_slow_list()
Date: Mon, 14 Oct 2019 14:56:53 +0100	[thread overview]
Message-ID: <4b19cd06-010c-bfcd-8a29-5b041fb9bc70@solarflare.com> (raw)
In-Reply-To: <20191014110201.6gnd4ewsls7bsmry@salvia>

On 14/10/2019 12:02, Pablo Neira Ayuso wrote:
> On Fri, Oct 11, 2019 at 12:54:33AM +0200, Florian Westphal wrote:
>> Edward Cree <ecree@solarflare.com> wrote:
>>> On 10/10/2019 23:30, Florian Westphal wrote:
>>>> NF_HOOK_LIST now only works for ipv4 and ipv6, as those are the only
>>>> callers.
>>> ...
>>>> +
>>>> +     rcu_read_lock();
>>>> +     switch (pf) {
>>>> +     case NFPROTO_IPV4:
>>>> +             hook_head = rcu_dereference(net->nf.hooks_ipv4[hook]);
>>>> +             break;
>>>> +     case NFPROTO_IPV6:
>>>> +             hook_head = rcu_dereference(net->nf.hooks_ipv6[hook]);
>>>> +             break;
>>>> +     default:
>>>> +             WARN_ON_ONCE(1);
>>>> +             break;
>>>>       }
>>> Would it not make sense instead to abstract out the switch in nf_hook()
>>>  into, say, an inline function that could be called from here?  That
>>>  would satisfy SPOT and also save updating this code if new callers of
>>>  NF_HOOK_LIST are added in the future.
>> Its a matter of taste I guess.  I don't really like having all these
>> inline wrappers for wrappers wrapped in wrappers.
>>
>> Pablo, its up to you.  I could add __nf_hook_get_hook_head() or similar
>> and use that instead of open-coding.
> I'm fine with your approach, Florian. If new callers are added, this
> can be done later on.
Fine, in that case feel free to add my
Acked-by: Edward Cree <ecree@solarflare.com>
The information contained in this message is confidential and is intended for the addressee(s) only. If you have received this message in error, please notify the sender immediately and delete the message. Unless you are an addressee (or authorized to receive for an addressee), you may not use, copy or disclose to anyone this message or any information contained in this message. The unauthorized use, disclosure, copying or alteration of this message is strictly prohibited.

  reply	other threads:[~2019-10-14 13:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-10 22:30 [PATCH v2 nf-next] netfilter: add and use nf_hook_slow_list() Florian Westphal
2019-10-10 22:41 ` Edward Cree
2019-10-10 22:54   ` Florian Westphal
2019-10-14 11:02     ` Pablo Neira Ayuso
2019-10-14 13:56       ` Edward Cree [this message]
2019-10-17 10:20 ` Pablo Neira Ayuso

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=4b19cd06-010c-bfcd-8a29-5b041fb9bc70@solarflare.com \
    --to=ecree@solarflare.com \
    --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 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).