]> git.baikalelectronics.ru Git - kernel.git/commit
bareudp: allow redirecting bareudp packets to eth devices
authorGuillaume Nault <gnault@redhat.com>
Fri, 25 Jun 2021 13:33:01 +0000 (15:33 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jun 2021 19:44:17 +0000 (12:44 -0700)
commit44a82daceea281cc56f5eff27f2b63a7cce06deb
tree27541f8678179147f553a4def8171e20e75c5903
parent5f3cfe83707dc6ea56948ea5b368eb25b8577492
bareudp: allow redirecting bareudp packets to eth devices

Even though bareudp transports L3 data (typically IP or MPLS), it needs
to reset the mac_header pointer, so that other parts of the stack don't
mistakenly access the outer header after the packet has been
decapsulated.

This allows to push an Ethernet header to bareudp packets and redirect
them to an Ethernet device:

  $ tc filter add dev bareudp0 ingress matchall      \
      action vlan push_eth dst_mac 00:00:5e:00:53:01 \
                           src_mac 00:00:5e:00:53:00 \
      action mirred egress redirect dev eth0

Without this patch, push_eth refuses to add an ethernet header because
the skb appears to already have a MAC header.

Signed-off-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bareudp.c