Patch "ip6_tunnel: disable caching when the traffic class is inherited" has been added to the 4.4-stable tree
Subsystems (3)
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.4-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.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Thu Dec 8 07:18:57 CET 2016
From: Paolo Abeni <[email protected]>
Date: Wed, 16 Nov 2016 16:26:46 +0100
Subject: ip6_tunnel: disable caching when the traffic class is inherited
From: Paolo Abeni <[email protected]>
[ 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.
--- net/ipv6/ip6_tunnel.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
net/ipv6/ip6_tunnel.c +11 -2
@@ -1043,6 +1043,7 @@ static int ip6_tnl_xmit2(struct sk_buffstruct ipv6_tel_txoption opt;struct dst_entry *dst =NULL , *ndst =NULL ;struct net_device *tdev; +bool use_cache = false;int mtu;unsigned int max_headroom =sizeof (struct ipv6hdr );u8 proto;
@@ -1070,7 +1071,15 @@ static int ip6_tnl_xmit2(struct sk_buffmemcpy (&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 =ip6_tnl_dst_get (t);if (!ip6_tnl_xmit_ctl (t, &fl6->saddr, &fl6->daddr))
@@ -1134,7 +1143,7 @@ static int ip6_tnl_xmit2(struct sk_buff skb = new_skb; } -if (!fl6->flowi6_mark && ndst) +if (use_cache && ndst)ip6_tnl_dst_set (t, ndst);skb_dst_set (skb, dst);
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/ip6_tunnel-disable-caching-when-the-traffic-class-is-inherited.patch