[VLAN] |PATCH| setting skb->dev to vlan device in vlan_hwaccel_rx is wrong ...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Frank Pavlic wrote:
> IHi ,
> I found a problem using vlan_hwaccel_rx function to pass skb to the stack.
> vlan_hwaccel_rx sets skb->dev to the vlan device accordingly to the vlan 
> id.
> After checking pkt_type netif_rx is called in non polling mode . 
> vlan_skb_recv 
> is called with a wrong skb->dev setting as the receive function is still 
> expecting 
> the real device .... , the problem also exists in 2.4 vlan code ...

While looking at the 2.4.27 code, I think that this fix may
already be in.

2.6.7 also looks correct.

What versions did you base these patches off of?

Ben

> 
> Frank
> 
> Kernel 2.6:
> 
> Index: include/linux/if_vlan.h
> ===================================================================
> RCS file: /home/cvs/linux-2.5/include/linux/if_vlan.h,v
> retrieving revision 1.10
> diff -B -u -b -r1.10 if_vlan.h
> --- include/linux/if_vlan.h     17 Aug 2004 11:50:08 -0000      1.10
> +++ include/linux/if_vlan.h     14 Oct 2004 13:43:58 -0000
> @@ -184,7 +184,7 @@
>                         skb->pkt_type = PACKET_HOST;
>                 break;
>         };
> -
> +       skb->dev = skb->real_dev;
>         return (polling ? netif_receive_skb(skb) : netif_rx(skb));
>  }
> 
> KERNEL > 2.4.21:
> 
> Index: include/linux/if_vlan.h
> ===================================================================
> RCS file: /home/cvs/linux-2.3/include/linux/if_vlan.h,v
> retrieving revision 1.6
> diff -B -u -b -r1.6 if_vlan.h
> --- include/linux/if_vlan.h     17 Feb 2003 10:36:43 -0000      1.6
> +++ include/linux/if_vlan.h     14 Oct 2004 13:45:39 -0000
> @@ -147,6 +147,7 @@
>                                     unsigned short vlan_tag, int polling)
>  {
>         struct net_device_stats *stats;
> +       struct net_device *real_dev = skb->dev;
> 
>         skb->dev = grp->vlan_devices[vlan_tag & VLAN_VID_MASK];
>         if (skb->dev == NULL) {
> @@ -182,7 +183,7 @@
>                         skb->pkt_type = PACKET_HOST;
>                 break;
>         };
> -
> +       skb->dev = real_dev;
>         return (polling ? netif_receive_skb(skb) : netif_rx(skb));
>  }
> 
> _______________________________________________
> Vlan mailing list
> Vlan@xxxxxxxxxxxx
> http://www.lanforge.com/mailman/listinfo/vlan
> 


-- 
Ben Greear <greearb@xxxxxxxxxxxxxxx>
Candela Technologies Inc  http://www.candelatech.com


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux