netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: herbert@gondor.apana.org.au
Cc: alexei.starovoitov@gmail.com, netdev@vger.kernel.org, hadi@cyberus.ca
Subject: Re: [v2] act_mirred: Fix bogus header when redirecting from VLAN
Date: Fri, 17 Apr 2015 13:29:02 -0400 (EDT)	[thread overview]
Message-ID: <20150417.132902.1510959002713450218.davem@davemloft.net> (raw)
In-Reply-To: <20150417053209.GA23855@gondor.apana.org.au>

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Fri, 17 Apr 2015 13:32:09 +0800

> On Thu, Apr 16, 2015 at 07:40:30PM -0700, Alexei Starovoitov wrote:
>> On Fri, Apr 17, 2015 at 10:15:01AM +0800, Herbert Xu wrote:
>> > > seems the cleaner fix will be to push skb->mac_len instead?
>> > 
>> > No skb->mac_len is the same as skb2->dev->hard_header_len.
>> 
>> hmm. please help me understand the problem then.
>> In the commit log you mentioned that your vlan dev and ifb
>> have unequal hard header length. I think that can only happen if
>> your master dev used to create vlan, didn't have vlan offload,
>> so vlandev->hhl = 18 and ifb->hhl = 14. Then when tagged packet
>> arrives on master device we call skb_vlan_untag() and
>> skb->mac_len becomes 14, then vlan_do_receive() will do
> 
> You are right.  I should've just used mac_len.
> 
> ---8<---
> When you redirect a VLAN device to any device, you end up with
> crap in af_packet on the xmit path because hard_header_len is
> not equal to skb->mac_len.  So the redirected packet contains
> four extra bytes at the start which then gets interpreted as
> part of the MAC address.
> 
> This patch fixes this by only pushing skb->mac_len.  We also
> need to fix ifb because it tries to undo the pushing done by
> act_mirred.
> 
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Applied.

      parent reply	other threads:[~2015-04-17 17:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-17  1:02 act_mirred: Fix bogus header when redirecting from VLAN Herbert Xu
2015-04-17  1:34 ` Alexei Starovoitov
2015-04-17  2:15   ` Herbert Xu
2015-04-17  2:40     ` Alexei Starovoitov
2015-04-17  5:32       ` [v2] " Herbert Xu
2015-04-17 15:26         ` Alexei Starovoitov
2015-04-17 17:29         ` David Miller [this message]

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=20150417.132902.1510959002713450218.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=alexei.starovoitov@gmail.com \
    --cc=hadi@cyberus.ca \
    --cc=herbert@gondor.apana.org.au \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).