Commit f40ae913 authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller

act_mirred: Fix bogus header when redirecting from VLAN

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: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Acked-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 521f1cf1
...@@ -105,7 +105,7 @@ static void ri_tasklet(unsigned long dev) ...@@ -105,7 +105,7 @@ static void ri_tasklet(unsigned long dev)
if (from & AT_EGRESS) { if (from & AT_EGRESS) {
dev_queue_xmit(skb); dev_queue_xmit(skb);
} else if (from & AT_INGRESS) { } else if (from & AT_INGRESS) {
skb_pull(skb, skb->dev->hard_header_len); skb_pull(skb, skb->mac_len);
netif_receive_skb(skb); netif_receive_skb(skb);
} else } else
BUG(); BUG();
......
...@@ -157,7 +157,7 @@ static int tcf_mirred(struct sk_buff *skb, const struct tc_action *a, ...@@ -157,7 +157,7 @@ static int tcf_mirred(struct sk_buff *skb, const struct tc_action *a,
if (!(at & AT_EGRESS)) { if (!(at & AT_EGRESS)) {
if (m->tcfm_ok_push) if (m->tcfm_ok_push)
skb_push(skb2, skb2->dev->hard_header_len); skb_push(skb2, skb->mac_len);
} }
/* mirror is always swallowed */ /* mirror is always swallowed */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment