net: Fix vlan_get_protocol for stacked vlan
commitd4bcef3fbe887ff93b58da4fcf6df1eee416e8fa
authorToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Thu, 29 Jan 2015 11:37:07 +0000 (29 20:37 +0900)
committerDavid S. Miller <davem@davemloft.net>
Sat, 31 Jan 2015 02:03:47 +0000 (30 18:03 -0800)
treecf4ad1600694c60733d7696727d7112acbc6e85c
parentcfbf654efc6d78dc9812e030673b86f235bf677d
net: Fix vlan_get_protocol for stacked vlan

vlan_get_protocol() could not get network protocol if a skb has a 802.1ad
vlan tag or multiple vlans, which caused incorrect checksum calculation
in several drivers.

Fix vlan_get_protocol() to retrieve network protocol instead of incorrect
vlan protocol.

As the logic is the same as skb_network_protocol(), create a common helper
function __vlan_get_protocol() and call it from existing functions.

Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/if_vlan.h
net/core/dev.c