[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKa-r6vsyzTOgwBFWiTkgTfm1u6jgSPST7C4mUZzL4SrVDA7rQ@mail.gmail.com>
Date: Fri, 9 Jun 2023 14:44:20 +0200
From: Davide Caratti <dcaratti@...hat.com>
To: Florian Westphal <fw@...len.de>
Cc: netdev@...r.kernel.org, kuba@...nel.org, edumazet@...gle.com,
davem@...emloft.net, pabeni@...hat.com, jhs@...atatu.com,
xiyou.wangcong@...il.com, jiri@...nulli.us,
Simon Horman <simon.horman@...igine.com>
Subject: Re: [PATCH net v2 2/3] net/sched: act_ipt: add sanity checks on skb
before calling target
On Thu, Jun 8, 2023 at 8:34 PM Florian Westphal <fw@...len.de> wrote:
>
> Davide Caratti <dcaratti@...hat.com> wrote:
> > hello Florian,
> >
> > On Thu, Jun 8, 2023 at 4:04 PM Florian Westphal <fw@...len.de> wrote:
> > >
> > > @@ -244,9 +264,22 @@ TC_INDIRECT_SCOPE int tcf_ipt_act(struct sk_buff *skb,
> > > .pf = NFPROTO_IPV4,
> > > };
> > >
> > > + if (skb->protocol != htons(ETH_P_IP))
> > > + return TC_ACT_UNSPEC;
> > > +
> >
> > maybe this can be converted to skb_protocol(skb, ...) so that it's
> > clear how VLAN packets are treated ?
>
> Not sure how to handle this.
>
> act_ipt claims NFPROTO_IPV4; for iptables/nftables one has to use
> the interface name ("-i vlan0") to match on the vlan interface.
>
> I don't really want to add code that pulls/pops the vlan headers
> in act_ipt...
then probably we can just call
skb_protocol(skb, false)
and check if it's equal to htons(ETH_P_IP):
In this case it will use skb->protocol or skb->vlan_proto (if the tag
is "accelerated") - no recursive QinQ lookup. WDYT?
thanks,
--
davide
Powered by blists - more mailing lists