]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: tag_8021q: Create helper function for removing VLAN header
authorVladimir Oltean <olteanv@gmail.com>
Sat, 8 Jun 2019 12:04:29 +0000 (15:04 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 8 Jun 2019 22:20:39 +0000 (15:20 -0700)
commit12a1c76610820144b1b0728687731c90b4d8e51e
treeb64fade690f6cf9244260f0640e0e02a1065eb29
parenta01c5b7bc76b896c80216547e2e5003f507aa523
net: dsa: tag_8021q: Create helper function for removing VLAN header

This removes the existing implementation from tag_sja1105, which was
partially incorrect (it was not changing the MAC header offset, thereby
leaving it to point 4 bytes earlier than it should have).

This overwrites the VLAN tag by moving the Ethernet source and
destination MACs 4 bytes to the right. Then skb->data (assumed to be
pointing immediately after the EtherType) is temporarily pushed to the
beginning of the new Ethernet header, the new Ethernet header offset and
length are recorded, then skb->data is moved back to where it was.

Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/dsa/8021q.h
net/dsa/tag_8021q.c
net/dsa/tag_sja1105.c