mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
vxlan: fix tos value before xmit
[ Upstream commit71130f2997] 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:206aaafcd2("VXLAN: Use IP Tunnels tunnel ENC encap API") Fixes:1400615d64("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ea3cc787e1
commit
57574c582f
@@ -2104,7 +2104,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
|
||||
else if (info->key.tun_flags & TUNNEL_DONT_FRAGMENT)
|
||||
df = htons(IP_DF);
|
||||
|
||||
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_build_skb(skb, &rt->dst, sizeof(struct iphdr),
|
||||
vni, md, flags, udp_sum);
|
||||
@@ -2163,7 +2163,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
|
||||
if (!info)
|
||||
udp_sum = !(flags & VXLAN_F_UDP_ZERO_CSUM6_TX);
|
||||
|
||||
tos = ip_tunnel_ecn_encap(tos, old_iph, skb);
|
||||
tos = ip_tunnel_ecn_encap(RT_TOS(tos), old_iph, skb);
|
||||
ttl = ttl ? : ip6_dst_hoplimit(ndst);
|
||||
skb_scrub_packet(skb, xnet);
|
||||
err = vxlan_build_skb(skb, ndst, sizeof(struct ipv6hdr),
|
||||
|
||||
Reference in New Issue
Block a user