]> 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)
commitcc7fd162584d7065373bcaaadbfbd6a1bd523add
treeb64fade690f6cf9244260f0640e0e02a1065eb29
parent980245251768c57b52a0b35a3d5b61c692625207
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