Re: [v2] act_mirred: Fix bogus header when redirecting from VLAN

2015-04-17 Thread David Miller
From: Herbert Xu 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

Re: [v2] act_mirred: Fix bogus header when redirecting from VLAN

2015-04-17 Thread Alexei Starovoitov
On Fri, Apr 17, 2015 at 01:32:09PM +0800, Herbert Xu wrote: > 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 get

[v2] act_mirred: Fix bogus header when redirecting from VLAN

2015-04-16 Thread Herbert Xu
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

Re: act_mirred: Fix bogus header when redirecting from VLAN

2015-04-16 Thread Alexei Starovoitov
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 ha

Re: act_mirred: Fix bogus header when redirecting from VLAN

2015-04-16 Thread Herbert Xu
On Thu, Apr 16, 2015 at 06:34:02PM -0700, Alexei Starovoitov wrote: > On Fri, Apr 17, 2015 at 09:02:16AM +0800, Herbert Xu wrote: > > @@ -105,7 +105,7 @@ static void ri_tasklet(unsigned long dev) > > if (from & AT_EGRESS) { > > dev_queue_xmit(skb); > > }

Re: act_mirred: Fix bogus header when redirecting from VLAN

2015-04-16 Thread Alexei Starovoitov
On Fri, Apr 17, 2015 at 09:02:16AM +0800, Herbert Xu wrote: > @@ -105,7 +105,7 @@ static void ri_tasklet(unsigned long dev) > if (from & AT_EGRESS) { > dev_queue_xmit(skb); > } else if (from & AT_INGRESS) { > - skb_pull(skb, skb-

act_mirred: Fix bogus header when redirecting from VLAN

2015-04-16 Thread Herbert Xu
When you redirect a VLAN device to an ifb device, you end up with crap within the ifb device because they have unequal hard header lengths and 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