]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
vxlan: fix tos value before xmit
authorHangbin Liu <liuhangbin@gmail.com>
Thu, 2 Jan 2020 09:23:45 +0000 (17:23 +0800)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 28 Apr 2020 18:03:14 +0000 (19:03 +0100)
commit 71130f29979c7c7956b040673e6b9d5643003176 upstream.

Before ip_tunnel_ecn_encap() and udp_tunnel_xmit_skb() we should filter
tos value by RT_TOS() instead of using config tos directly.

vxlan_get_route() would filter the tos to fl4.flowi4_tos but we didn't
return it back, as geneve_get_v4_rt() did. So we have to use RT_TOS()
directly in function ip_tunnel_ecn_encap().

Fixes: 206aaafcd279 ("VXLAN: Use IP Tunnels tunnel ENC encap API")
Fixes: 1400615d64cf ("vxlan: allow setting ipv6 traffic class")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/vxlan.c

index 73874090cf4267128dfcbf0253c910589dc1b9fa..11736ad7c835435888dc51c8d5ca6e74256e8765 100644 (file)
@@ -1904,7 +1904,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
                        return;
                }
 
-               tos = ip_tunnel_ecn_encap(tos, old_iph, skb);
+               tos = ip_tunnel_ecn_encap(RT_TOS(tos), old_iph, skb);
                ttl = ttl ? : ip4_dst_hoplimit(&rt->dst);
 
                err = vxlan_xmit_skb(vxlan->vn_sock, rt, skb,