net: Fix stacked vlan offload features computation
authorToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Mon, 22 Dec 2014 10:04:14 +0000 (19:04 +0900)
committerZefan Li <lizefan@huawei.com>
Tue, 14 Apr 2015 09:33:48 +0000 (17:33 +0800)
commit3f2bfecbcd11c03e3a0303c99097981edc386cb9
treeb5b965a1b51e1fdc3659805154d6627a329b5446
parent6fb66b080a2694ac17ed5fc7309136e89c1b0884
net: Fix stacked vlan offload features computation

commit 796f2da81bead71ffc91ef70912cd8d1827bf756 upstream.

When vlan tags are stacked, it is very likely that the outer tag is stored
in skb->vlan_tci and skb->protocol shows the inner tag's vlan_proto.
Currently netif_skb_features() first looks at skb->protocol even if there
is the outer tag in vlan_tci, thus it incorrectly retrieves the protocol
encapsulated by the inner vlan instead of the inner vlan protocol.
This allows GSO packets to be passed to HW and they end up being
corrupted.

Fixes: 58e998c6d239 ("offloading: Force software GSO for multiple vlan tags.")
Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
[lizf: Backported to 3.4:
 - remove ETH_P_8021AD
 - pass protocol to harmonize_features()]
Signed-off-by: Zefan Li <lizefan@huawei.com>
net/core/dev.c