OSDN Git Service

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)
commitd461933638ae9fa49ad22f60a40de5b3ed414912
treeb64fade690f6cf9244260f0640e0e02a1065eb29
parent5e3f847a02aabfecea519d7b2fd48f4d6f551be6
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