From: Florian Westphal <fw@strlen.de>
To: Eugene Crosser <crosser@average.org>
Cc: Florian Westphal <fw@strlen.de>,
netdev@vger.kernel.org, netfilter-devel@vger.kernel.org,
dsahern@kernel.org, pablo@netfilter.org,
lschlesinger@drivenets.com
Subject: Re: [PATCH net-next 2/2] vrf: run conntrack only in context of lower/physdev for locally generated packets
Date: Fri, 22 Oct 2021 01:58:19 +0200 [thread overview]
Message-ID: <20211021235819.GF7604@breakpoint.cc> (raw)
In-Reply-To: <dbbc274e-cf69-5207-6ddd-00c435d5a689@average.org>
Eugene Crosser <crosser@average.org> wrote:
> > +static void vrf_nf_set_untracked(struct sk_buff *skb)
> > +{
> > + if (skb_get_nfct(skb) == 0)
> > + nf_ct_set(skb, 0, IP_CT_UNTRACKED);
> > +}
> > +
> > +static void vrf_nf_reset_ct(struct sk_buff *skb)
> > +{
> > + if (skb_get_nfct(skb) == IP_CT_UNTRACKED)
> > + nf_reset_ct(skb);
> > +}
> > +
>
> Isn't it possible that skb was marked UNTRACKED before entering this path, by a
> rule?
I don't think so, it should be called before any ruleset evaluation has
taken place.
> In such case 'set_untrackd' will do nothing, but 'reset_ct' will clear
> UNTRACKED status that was set elswhere. It seems wrong, am I missing something?
No, thats the catch. I can't find a better option.
I can add a patch to disable all of the NF_HOOK() invocations from vrf
which removes the ability to filter on vrf interface names.
The option to add a caller_id to nf_hook_state struct (so conntrack/nat
can detect when they are called from the vrf hooks) either needs
copypastry of entire NF_HOOK* inline functions into vrf (so the 'is-vrf'
flag can be enabled) or yet another argument to NF_HOOK().
It also leaks even more 'is vrf' checks into conntrack.
next prev parent reply other threads:[~2021-10-21 23:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-21 14:48 [PATCH net-next 0/2] vrf: rework interaction with netfilter/conntrack Florian Westphal
2021-10-21 14:48 ` [PATCH net-next 1/2] netfilter: conntrack: skip confirmation and nat hooks in postrouting for vrf Florian Westphal
2021-10-21 14:48 ` [PATCH net-next 2/2] vrf: run conntrack only in context of lower/physdev for locally generated packets Florian Westphal
2021-10-21 22:25 ` Jakub Kicinski
2021-10-21 23:03 ` Eugene Crosser
2021-10-21 23:58 ` Florian Westphal [this message]
2021-10-22 0:04 ` Florian Westphal
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=20211021235819.GF7604@breakpoint.cc \
--to=fw@strlen.de \
--cc=crosser@average.org \
--cc=dsahern@kernel.org \
--cc=lschlesinger@drivenets.com \
--cc=netdev@vger.kernel.org \
--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.