[PATCH 0/4 net-next] Allow to inherit from VLAN encapsulated IP

From: Matthias May
Date: Mon Jul 11 2022 - 05:35:03 EST


Currently IPv4 and IPv6 tunnels are able to inherit IP header fields
like TOS, TTL or the DF from their payload, when the payload is IPv4
or IPv6. Some types of tunnels, like GRETAP or VXLAN are able to carry
VLANs. The visible skb->protocol shows in this case as protocol
ETH_P_8021Q or ETH_P_8021AD. However all the relevant structures for IP
payload are correct and just need to be used.

Patch 1 allows tunnels with IPv4 as outer header to inherit from VLAN
encapsulated payload.
Patch 2 fixes a bug, where the DSCP for tunnels with IPv6 as outer header
is never set.
Patch 3 allows tunnels with IPv6 as outer header to inherit the TTL from
VLAN encapsulated payload.
Patch 4 allows IP6GRETAP tunnels with IPv6 as outer header to inherit the
TOS from VLAN encapsulated payload.

Matthias May (4):
ip_tunnel: allow to inherit from VLAN encapsulated IP
ip6_gre: set DSCP for non-IP
ip6_gre: use actual protocol to select xmit
ip6_tunnel: allow to inherit from VLAN encapsulated IP

net/ipv4/ip_tunnel.c | 17 +++++++++--------
net/ipv6/ip6_gre.c | 43 +++++++++++++++++++++++++++++++++++--------
net/ipv6/ip6_tunnel.c | 11 +++++++----
3 files changed, 51 insertions(+), 20 deletions(-)

--
2.35.1