From: Greg Kroah-Hartman Date: Fri, 23 Jun 2023 11:10:22 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v4.14.320~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=75a81edf367eba206d335e95415a53dafe3b0b45;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: ip_tunnels-allow-vxlan-geneve-to-inherit-tos-ttl-from-vlan.patch --- diff --git a/queue-5.4/ip_tunnels-allow-vxlan-geneve-to-inherit-tos-ttl-from-vlan.patch b/queue-5.4/ip_tunnels-allow-vxlan-geneve-to-inherit-tos-ttl-from-vlan.patch new file mode 100644 index 00000000000..b714c8fdb71 --- /dev/null +++ b/queue-5.4/ip_tunnels-allow-vxlan-geneve-to-inherit-tos-ttl-from-vlan.patch @@ -0,0 +1,56 @@ +From 7074732c8faee201a245a6f983008a5789c0be33 Mon Sep 17 00:00:00 2001 +From: Matthias May +Date: Thu, 21 Jul 2022 22:27:19 +0200 +Subject: ip_tunnels: allow VXLAN/GENEVE to inherit TOS/TTL from VLAN + +From: Matthias May + +commit 7074732c8faee201a245a6f983008a5789c0be33 upstream. + +The current code allows for VXLAN and GENEVE to inherit the TOS +respective the TTL when skb-protocol is ETH_P_IP or ETH_P_IPV6. +However when the payload is VLAN encapsulated, then this inheriting +does not work, because the visible skb-protocol is of type +ETH_P_8021Q or ETH_P_8021AD. + +Instead of skb->protocol use skb_protocol(). + +Signed-off-by: Matthias May +Link: https://lore.kernel.org/r/20220721202718.10092-1-matthias.may@westermo.com +Signed-off-by: Jakub Kicinski +Cc: Nicolas Dichtel +Signed-off-by: Greg Kroah-Hartman +--- + include/net/ip_tunnels.h | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +--- a/include/net/ip_tunnels.h ++++ b/include/net/ip_tunnels.h +@@ -374,9 +374,11 @@ static inline int ip_tunnel_encap(struct + static inline u8 ip_tunnel_get_dsfield(const struct iphdr *iph, + const struct sk_buff *skb) + { +- if (skb->protocol == htons(ETH_P_IP)) ++ __be16 payload_protocol = skb_protocol(skb, true); ++ ++ if (payload_protocol == htons(ETH_P_IP)) + return iph->tos; +- else if (skb->protocol == htons(ETH_P_IPV6)) ++ else if (payload_protocol == htons(ETH_P_IPV6)) + return ipv6_get_dsfield((const struct ipv6hdr *)iph); + else + return 0; +@@ -385,9 +387,11 @@ static inline u8 ip_tunnel_get_dsfield(c + static inline u8 ip_tunnel_get_ttl(const struct iphdr *iph, + const struct sk_buff *skb) + { +- if (skb->protocol == htons(ETH_P_IP)) ++ __be16 payload_protocol = skb_protocol(skb, true); ++ ++ if (payload_protocol == htons(ETH_P_IP)) + return iph->ttl; +- else if (skb->protocol == htons(ETH_P_IPV6)) ++ else if (payload_protocol == htons(ETH_P_IPV6)) + return ((const struct ipv6hdr *)iph)->hop_limit; + else + return 0; diff --git a/queue-5.4/series b/queue-5.4/series index 4b217d892c2..d469c630673 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -13,3 +13,4 @@ drivers-hv-vmbus-fix-vmbus_wait_for_unload-to-scan-present-cpus.patch pci-hv-fix-a-race-condition-bug-in-hv_pci_query_relations.patch cgroup-do-not-corrupt-task-iteration-when-rebinding-subsystem.patch mmc-meson-gx-remove-redundant-mmc_request_done-call-from-irq-context.patch +ip_tunnels-allow-vxlan-geneve-to-inherit-tos-ttl-from-vlan.patch