All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Davide Caratti <dcaratti@redhat.com>
Cc: Florian Westphal <fw@strlen.de>,
	netdev@vger.kernel.org, kuba@kernel.org, edumazet@google.com,
	davem@davemloft.net, pabeni@redhat.com, jhs@mojatatu.com,
	xiyou.wangcong@gmail.com, jiri@resnulli.us,
	Simon Horman <simon.horman@corigine.com>
Subject: Re: [PATCH net v2 2/3] net/sched: act_ipt: add sanity checks on skb before calling target
Date: Thu, 8 Jun 2023 20:34:31 +0200	[thread overview]
Message-ID: <20230608183431.GF27126@breakpoint.cc> (raw)
In-Reply-To: <CAKa-r6uyObXeAUTj28=f+V8BvrUQpXGP12JHRikct3SB=x48GA@mail.gmail.com>

Davide Caratti <dcaratti@redhat.com> wrote:
> hello Florian,
> 
> On Thu, Jun 8, 2023 at 4:04 PM Florian Westphal <fw@strlen.de> wrote:
> >
> > Netfilter targets make assumptions on the skb state, for example
> > iphdr is supposed to be in the linear area.
> >
> [...]
> 
> > @@ -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...

  reply	other threads:[~2023-06-08 18:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-08 14:02 [PATCH net v2 0/3] net/sched: act_ipt bug fixes Florian Westphal
2023-06-08 14:02 ` [PATCH net v2 1/3] net/sched: act_ipt: add sanity checks on table name and hook locations Florian Westphal
2023-06-08 16:51   ` Jamal Hadi Salim
2023-06-08 14:02 ` [PATCH net v2 2/3] net/sched: act_ipt: add sanity checks on skb before calling target Florian Westphal
2023-06-08 15:04   ` Davide Caratti
2023-06-08 18:34     ` Florian Westphal [this message]
2023-06-09 12:44       ` Davide Caratti
2023-06-08 17:08   ` Jamal Hadi Salim
2023-06-08 14:02 ` [PATCH net v2 3/3] net/sched: act_ipt: zero skb->cb " Florian Westphal
2023-06-08 17:05   ` Jamal Hadi Salim
2023-06-08 18:28     ` Florian Westphal
2023-06-09 11:58       ` Jamal Hadi Salim
2023-06-08 16:50 ` [PATCH net v2 0/3] net/sched: act_ipt bug fixes Jamal Hadi Salim
2023-06-08 18:36   ` 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=20230608183431.GF27126@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=davem@davemloft.net \
    --cc=dcaratti@redhat.com \
    --cc=edumazet@google.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=simon.horman@corigine.com \
    --cc=xiyou.wangcong@gmail.com \
    /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.