| From 41b1bcde46796c1a69d016eee58f2d2ab7a1f268 Mon Sep 17 00:00:00 2001 |
| From: Hangbin Liu <liuhangbin@gmail.com> |
| Date: Wed, 5 Aug 2020 10:41:31 +0800 |
| Subject: [PATCH] Revert "vxlan: fix tos value before xmit" |
| |
| commit a0dced17ad9dc08b1b25e0065b54c97a318e6e8b upstream. |
| |
| This reverts commit 71130f29979c7c7956b040673e6b9d5643003176. |
| |
| In commit 71130f29979c ("vxlan: fix tos value before xmit") we want to |
| make sure the tos value are filtered by RT_TOS() based on RFC1349. |
| |
| 0 1 2 3 4 5 6 7 |
| +-----+-----+-----+-----+-----+-----+-----+-----+ |
| | PRECEDENCE | TOS | MBZ | |
| +-----+-----+-----+-----+-----+-----+-----+-----+ |
| |
| But RFC1349 has been obsoleted by RFC2474. The new DSCP field defined like |
| |
| 0 1 2 3 4 5 6 7 |
| +-----+-----+-----+-----+-----+-----+-----+-----+ |
| | DS FIELD, DSCP | ECN FIELD | |
| +-----+-----+-----+-----+-----+-----+-----+-----+ |
| |
| So with |
| |
| IPTOS_TOS_MASK 0x1E |
| RT_TOS(tos) ((tos)&IPTOS_TOS_MASK) |
| |
| the first 3 bits DSCP info will get lost. |
| |
| To take all the DSCP info in xmit, we should revert the patch and just push |
| all tos bits to ip_tunnel_ecn_encap(), which will handling ECN field later. |
| |
| Fixes: 71130f29979c ("vxlan: fix tos value before xmit") |
| Signed-off-by: Hangbin Liu <liuhangbin@gmail.com> |
| Acked-by: Guillaume Nault <gnault@redhat.com> |
| Signed-off-by: David S. Miller <davem@davemloft.net> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c |
| index f6c3030e282f..195fae570455 100644 |
| --- a/drivers/net/vxlan.c |
| +++ b/drivers/net/vxlan.c |
| @@ -2532,7 +2532,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, |
| ndst = &rt->dst; |
| skb_tunnel_check_pmtu(skb, ndst, VXLAN_HEADROOM); |
| |
| - tos = ip_tunnel_ecn_encap(RT_TOS(tos), old_iph, skb); |
| + tos = ip_tunnel_ecn_encap(tos, old_iph, skb); |
| ttl = ttl ? : ip4_dst_hoplimit(&rt->dst); |
| err = vxlan_build_skb(skb, ndst, sizeof(struct iphdr), |
| vni, md, flags, udp_sum); |
| @@ -2572,7 +2572,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, |
| |
| skb_tunnel_check_pmtu(skb, ndst, VXLAN6_HEADROOM); |
| |
| - tos = ip_tunnel_ecn_encap(RT_TOS(tos), old_iph, skb); |
| + tos = ip_tunnel_ecn_encap(tos, old_iph, skb); |
| ttl = ttl ? : ip6_dst_hoplimit(ndst); |
| skb_scrub_packet(skb, xnet); |
| err = vxlan_build_skb(skb, ndst, sizeof(struct ipv6hdr), |
| -- |
| 2.27.0 |
| |