From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eli Cooper Subject: [PATCH] ip6_tunnel: disable dst caching if tunnel is dual-stack Date: Mon, 25 Dec 2017 10:43:49 +0800 Message-ID: <20171225024349.4879-1-elicooper@gmx.com> Cc: "David S . Miller" To: netdev@vger.kernel.org Return-path: Received: from mout.gmx.net ([212.227.17.21]:64200 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751711AbdLYCoC (ORCPT ); Sun, 24 Dec 2017 21:44:02 -0500 Sender: netdev-owner@vger.kernel.org List-ID: When an ip6_tunnel is in mode 'any', where the transport layer protocol can be either 4 or 41, dst_cache must be disabled. This is because xfrm policies might apply to only one of the two protocols. Caching dst would cause xfrm policies for one protocol incorrectly used for the other. Cc: stable@vger.kernel.org Signed-off-by: Eli Cooper --- net/ipv6/ip6_tunnel.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 931c38f6ff4a..8aea23d15ddd 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c @@ -1074,10 +1074,10 @@ int ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev, __u8 dsfield, memcpy(&fl6->daddr, addr6, sizeof(fl6->daddr)); neigh_release(neigh); } - } else if (!(t->parms.flags & + } else if (t->parms.proto != 0 && !(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 + /* enable the cache only if neither the outer protocol nor the + * routing decision depends on the current inner header value */ use_cache = true; } -- 2.15.1