• Guillaume Nault's avatar
    net/sched: act_vlan: Add {POP,PUSH}_ETH actions · 19fbcb36
    Guillaume Nault authored
    Implement TCA_VLAN_ACT_POP_ETH and TCA_VLAN_ACT_PUSH_ETH, to
    respectively pop and push a base Ethernet header at the beginning of a
    frame.
    
    POP_ETH is just a matter of pulling ETH_HLEN bytes. VLAN tags, if any,
    must be stripped before calling POP_ETH.
    
    PUSH_ETH is restricted to skbs with no mac_header, and only the MAC
    addresses can be configured. The Ethertype is automatically set from
    skb->protocol. These restrictions ensure that all skb's fields remain
    consistent, so that this action can't confuse other part of the
    networking stack (like GSO).
    
    Since openvswitch already had these actions, consolidate the code in
    skbuff.c (like for vlan and mpls push/pop).
    Signed-off-by: default avatarGuillaume Nault <gnault@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    19fbcb36
tc_vlan.h 1.67 KB