]> git.baikalelectronics.ru Git - kernel.git/commit
vlan: Fix out of order vlan headers with reorder header off
authorToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Tue, 13 Mar 2018 05:51:28 +0000 (14:51 +0900)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Mar 2018 14:03:47 +0000 (10:03 -0400)
commitfa5aef266d4bb2ee59e34177bd9d56a48bd0cc0c
tree7805f8eec1279109bf15a6177f286a0aacbf017c
parentd26c74582e930f5d60ad840574a95dc67a9283df
vlan: Fix out of order vlan headers with reorder header off

With reorder header off, received packets are untagged in skb_vlan_untag()
called from within __netif_receive_skb_core(), and later the tag will be
inserted back in vlan_do_receive().

This caused out of order vlan headers when we create a vlan device on top
of another vlan device, because vlan_do_receive() inserts a tag as the
outermost vlan tag. E.g. the outer tag is first removed in skb_vlan_untag()
and inserted back in vlan_do_receive(), then the inner tag is next removed
and inserted back as the outermost tag.

This patch fixes the behaviour by inserting the inner tag at the right
position.

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/8021q/vlan_core.c