[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aFhksV47fCiriwJ4@strlen.de>
Date: Sun, 22 Jun 2025 22:16:49 +0200
From: Florian Westphal <fw@...len.de>
To: Eric Woudstra <ericwouds@...il.com>
Cc: Pablo Neira Ayuso <pablo@...filter.org>,
Jozsef Kadlecsik <kadlec@...filter.org>,
Nikolay Aleksandrov <razor@...ckwall.org>,
Ido Schimmel <idosch@...dia.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>, netfilter-devel@...r.kernel.org,
bridge@...ts.linux.dev, netdev@...r.kernel.org
Subject: Re: [PATCH v12 nf-next 1/2] netfilter: bridge: Add conntrack double
vlan and pppoe
Eric Woudstra <ericwouds@...il.com> wrote:
> - if (ret != NF_ACCEPT)
> - return ret;
> + if (ret == NF_ACCEPT)
> + ret = nf_conntrack_in(skb, &bridge_state);
>
> - return nf_conntrack_in(skb, &bridge_state);
> +do_not_track:
> + if (offset) {
> + __skb_push(skb, offset);
nf_conntrack_in() can free the skb, or steal it.
But aside from this, I'm not sure this is a good idea to begin with,
it feels like we start to reimplement br_netfilter.c .
Perhaps it would be better to not push/pull but instead rename
unsigned int
nf_conntrack_in(struct sk_buff *skb, const struct nf_hook_state *state)
to
unsigned int
nf_conntrack_inner(struct sk_buff *skb, const struct nf_hook_state *state,
unsigned int nhoff)
and add
unsigned int
nf_conntrack_in(struct sk_buff *skb, const struct nf_hook_state *state)
{
return nf_conntrack_inner(skb, state, skb_network_offset(skb));
}
Or, alternatively, add
struct nf_ct_pktoffs {
u16 nhoff;
u16 thoff;
};
then populate that from nf_ct_bridge_pre(), then pass that to
nf_conntrack_inner() (all names are suggestions, if you find something
better thats fine).
Its going to be more complicated than this, but my point is that e.g.
nf_ct_get_tuple() already gets the l4 offset, so why not pass l3
offset too?
Powered by blists - more mailing lists