Return-Path: Received: from mail-bn3nam01on0134.outbound.protection.outlook.com ([104.47.33.134]:39072 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965619AbeCSQD7 (ORCPT ); Mon, 19 Mar 2018 12:03:59 -0400 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Liam McBirnie , Liam McBirnie , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 194/281] ip6_tunnel: fix traffic class routing for tunnels Date: Mon, 19 Mar 2018 16:01:42 +0000 Message-ID: <20180319155742.13731-194-alexander.levin@microsoft.com> References: <20180319155742.13731-1-alexander.levin@microsoft.com> In-Reply-To: <20180319155742.13731-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Liam McBirnie [ Upstream commit 5f733ee68f9a4df94775299ac6a7ab260704f6ed ] ip6_route_output() requires that the flowlabel contains the traffic class for policy routing. Commit 0e9a709560db ("ip6_tunnel, ip6_gre: fix setting of DSCP on encapsulated packets") removed the code which previously added the traffic class to the flowlabel. The traffic class is added here because only route lookup needs the flowlabel to contain the traffic class. Fixes: 0e9a709560db ("ip6_tunnel, ip6_gre: fix setting of DSCP on encapsula= ted packets") Signed-off-by: Liam McBirnie Acked-by: Peter Dawson Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/ipv6/ip6_tunnel.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index a2fcf7bdb597..f185126b0327 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c @@ -1097,6 +1097,9 @@ int ip6_tnl_xmit(struct sk_buff *skb, struct net_devi= ce *dev, __u8 dsfield, =20 if (!dst) { route_lookup: + /* add dsfield to flowlabel for route lookup */ + fl6->flowlabel =3D ip6_make_flowinfo(dsfield, fl6->flowlabel); + dst =3D ip6_route_output(net, NULL, fl6); =20 if (dst->error) --=20 2.14.1