From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00285C33CA4 for ; Sat, 11 Jan 2020 10:33:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C094020678 for ; Sat, 11 Jan 2020 10:33:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578738815; bh=yWzHrt0DsAtoHX5GuKIUt91IM/ZOpBXSoBuEPzdtW+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=iHeoRb3L6Mq8GgCJjBmC9J131iqSyBYQxQ+xzrg4osbQ+0Vpi1hLQjH2Xolbd3AyI eUEiIBbveoX3xTabwHwOF44iDyjVhvxcyVS0juqBSE/XaZ9m+oLhvGbIlmzBw1ZKPH vt2ulTlVdTyagHkbeJJfrhOS1GCKijqbMrkDvoWo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731623AbgAKKdf (ORCPT ); Sat, 11 Jan 2020 05:33:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:48324 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731612AbgAKKdd (ORCPT ); Sat, 11 Jan 2020 05:33:33 -0500 Received: from localhost (unknown [62.119.166.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9660F21744; Sat, 11 Jan 2020 10:33:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578738812; bh=yWzHrt0DsAtoHX5GuKIUt91IM/ZOpBXSoBuEPzdtW+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vji2kS9yewMGj6uQ8KG2R9jhsmhGpvE6gre4+i++wy9UMA4p8opS2UNRpAX2JeiEh C7tkvG68xildqRGu2AAo3IUS+W0Qh3CS0Zc97rKl2zICgTh/Ud0vOCEFt+JSurFHXq C/vPwPYMG6tSXQYAClDp8yYGC043XySO/Rzv6CeU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hangbin Liu , "David S. Miller" Subject: [PATCH 5.4 150/165] vxlan: fix tos value before xmit Date: Sat, 11 Jan 2020 10:51:09 +0100 Message-Id: <20200111094940.471588748@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200111094921.347491861@linuxfoundation.org> References: <20200111094921.347491861@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hangbin Liu [ Upstream commit 71130f29979c7c7956b040673e6b9d5643003176 ] 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 Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/vxlan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -2542,7 +2542,7 @@ static void vxlan_xmit_one(struct sk_buf ndst = &rt->dst; skb_tunnel_check_pmtu(skb, ndst, VXLAN_HEADROOM); - 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, ndst, sizeof(struct iphdr), vni, md, flags, udp_sum); @@ -2582,7 +2582,7 @@ static void vxlan_xmit_one(struct sk_buf skb_tunnel_check_pmtu(skb, ndst, VXLAN6_HEADROOM); - 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),