All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
	Martin Olsson <martin.olsson+netdev@sentorsecurity.com>,
	Jiri Pirko <jiri@resnulli.us>, Lucas Bates <lucasb@mojatatu.com>
Subject: Re: [Patch net] net_sched: refetch skb protocol for each filter
Date: Sun, 13 Jan 2019 13:08:40 -0800	[thread overview]
Message-ID: <CAM_iQpW2mHvyBRmjomMZN7b-vizOFVTOkJKL3Aq3fmukfbc5tA@mail.gmail.com> (raw)
In-Reply-To: <2c84f3cc-b1ad-5316-4813-e7e433bf9f5e@mojatatu.com>

On Sat, Jan 12, 2019 at 7:41 AM Jamal Hadi Salim <jhs@mojatatu.com> wrote:
>
> On 2019-01-12 7:23 a.m., Jamal Hadi Salim wrote:
>
> > Do we have a test case for a setup like this in tdc?
> > i.e incoming tagged and then vlan popped by action?
> > Otherwise a test with IFE which resets the ethertype
> > would be sufficient i.e just something that will messup
> > with skb->protocol.
>
> And here is a slightly complex test with IFE.
> Wanted to show both reclassify and continue in play
> as well as something that change skb->protocol.
>

I don't know why you need a complex one, Martin's
test case is pretty simple (as I already sent to you).

Also, you can add two printk()'s around the skb_vlan_pop()
in tcf_vlan_act() to see the difference of tc_skb_protocol()
return values before and after. I tried, it clearly shows
ETH_P_8021Q and ETH_P_IP.

Of course, it could be tc_skb_protocol() which is wrong,
as skb->protocol stays same.

This patch is always correct despite of tc_skb_protocol():

1. If tc_skb_protocol() is wrong, this patch fixes nothing,
and harms nothing.

2. If tc_skb_protocol() is correct, this patch fixes a bug.

Changing tc_skb_protocol() is much more risky than this
patch. You fixed a very similar bug before:

commit 619fe32640b4b01f370574d50344ae0f62689816
Author: Jamal Hadi Salim <jhs@mojatatu.com>
Date:   Thu Feb 18 07:38:04 2016 -0500

    net_sched fix: reclassification needs to consider ether protocol changes

which also implies tc_skb_protocol() is correct.

Thanks.

  reply	other threads:[~2019-01-13 21:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-12  2:55 [Patch net] net_sched: refetch skb protocol for each filter Cong Wang
2019-01-12 12:23 ` Jamal Hadi Salim
2019-01-12 15:41   ` Jamal Hadi Salim
2019-01-13 21:08     ` Cong Wang [this message]
2019-01-15 15:59       ` Jamal Hadi Salim
2019-01-15 16:21         ` Jamal Hadi Salim
2019-01-15 17:57           ` Cong Wang
2019-01-16 14:02             ` Jamal Hadi Salim
2019-01-15 17:52         ` Cong Wang
2019-01-13 20:58   ` Cong Wang
2019-01-15 15:14     ` Jamal Hadi Salim
2019-01-14  9:15   ` Martin Olsson
2019-01-15 15:19     ` Jamal Hadi Salim
2019-01-14 23:13   ` Lucas Bates
2019-01-14  9:23 ` Daniel Borkmann
2019-01-14 19:55   ` Cong Wang
2019-01-16 13:59 ` Jamal Hadi Salim

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=CAM_iQpW2mHvyBRmjomMZN7b-vizOFVTOkJKL3Aq3fmukfbc5tA@mail.gmail.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=lucasb@mojatatu.com \
    --cc=martin.olsson+netdev@sentorsecurity.com \
    --cc=netdev@vger.kernel.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.