Skip to content

Commit 71130f2

Browse files
liuhangbindavem330
authored andcommitted
vxlan: fix tos value before xmit
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: 206aaaf ("VXLAN: Use IP Tunnels tunnel ENC encap API") Fixes: 1400615 ("vxlan: allow setting ipv6 traffic class") Signed-off-by: Hangbin Liu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 68aab82 commit 71130f2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/net/vxlan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2541,7 +2541,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
25412541
ndst = &rt->dst;
25422542
skb_tunnel_check_pmtu(skb, ndst, VXLAN_HEADROOM);
25432543

2544-
tos = ip_tunnel_ecn_encap(tos, old_iph, skb);
2544+
tos = ip_tunnel_ecn_encap(RT_TOS(tos), old_iph, skb);
25452545
ttl = ttl ? : ip4_dst_hoplimit(&rt->dst);
25462546
err = vxlan_build_skb(skb, ndst, sizeof(struct iphdr),
25472547
vni, md, flags, udp_sum);
@@ -2581,7 +2581,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
25812581

25822582
skb_tunnel_check_pmtu(skb, ndst, VXLAN6_HEADROOM);
25832583

2584-
tos = ip_tunnel_ecn_encap(tos, old_iph, skb);
2584+
tos = ip_tunnel_ecn_encap(RT_TOS(tos), old_iph, skb);
25852585
ttl = ttl ? : ip6_dst_hoplimit(ndst);
25862586
skb_scrub_packet(skb, xnet);
25872587
err = vxlan_build_skb(skb, ndst, sizeof(struct ipv6hdr),

0 commit comments

Comments
 (0)