From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:57646 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752479AbcLHGVs (ORCPT ); Thu, 8 Dec 2016 01:21:48 -0500 Subject: Patch "ip6_tunnel: disable caching when the traffic class is inherited" has been added to the 4.8-stable tree To: pabeni@redhat.com, davem@davemloft.net, gregkh@linuxfoundation.org, hannes@stressinduktion.org, liam.mcbirnie@boeing.com Cc: , From: Date: Thu, 08 Dec 2016 07:20:50 +0100 Message-ID: <148117805048229@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled ip6_tunnel: disable caching when the traffic class is inherited to the 4.8-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: ip6_tunnel-disable-caching-when-the-traffic-class-is-inherited.patch and it can be found in the queue-4.8 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From foo@baz Thu Dec 8 07:19:12 CET 2016 From: Paolo Abeni Date: Wed, 16 Nov 2016 16:26:46 +0100 Subject: ip6_tunnel: disable caching when the traffic class is inherited From: Paolo Abeni [ Upstream commit b5c2d49544e5930c96e2632a7eece3f4325a1888 ] If an ip6 tunnel is configured to inherit the traffic class from the inner header, the dst_cache must be disabled or it will foul the policy routing. The issue is apprently there since at leat Linux-2.6.12-rc2. Reported-by: Liam McBirnie Cc: Liam McBirnie Acked-by: Hannes Frederic Sowa Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv6/ip6_tunnel.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c @@ -1014,6 +1014,7 @@ int ip6_tnl_xmit(struct sk_buff *skb, st int mtu; unsigned int psh_hlen = sizeof(struct ipv6hdr) + t->encap_hlen; unsigned int max_headroom = psh_hlen; + bool use_cache = false; int err = -1; /* NBMA tunnel */ @@ -1038,7 +1039,15 @@ int ip6_tnl_xmit(struct sk_buff *skb, st memcpy(&fl6->daddr, addr6, sizeof(fl6->daddr)); neigh_release(neigh); - } else if (!fl6->flowi6_mark) + } else if (!(t->parms.flags & + (IP6_TNL_F_USE_ORIG_TCLASS | IP6_TNL_F_USE_ORIG_FWMARK))) { + /* enable the cache only only if the routing decision does + * not depend on the current inner header value + */ + use_cache = true; + } + + if (use_cache) dst = dst_cache_get(&t->dst_cache); if (!ip6_tnl_xmit_ctl(t, &fl6->saddr, &fl6->daddr)) @@ -1113,7 +1122,7 @@ int ip6_tnl_xmit(struct sk_buff *skb, st skb = new_skb; } - if (!fl6->flowi6_mark && ndst) + if (use_cache && ndst) dst_cache_set_ip6(&t->dst_cache, ndst, &fl6->saddr); skb_dst_set(skb, dst); Patches currently in stable-queue which might be from pabeni@redhat.com are queue-4.8/ip6_tunnel-disable-caching-when-the-traffic-class-is-inherited.patch queue-4.8/ipv6-bump-genid-when-the-ifa_f_tentative-flag-is-clear.patch