Commit 23263ec8 authored by Eli Cooper's avatar Eli Cooper Committed by David S. Miller

ip6_tunnel: disable dst caching if tunnel is dual-stack

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.
Signed-off-by: default avatarEli Cooper <elicooper@gmx.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 55a5ec9b
...@@ -1074,10 +1074,11 @@ int ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev, __u8 dsfield, ...@@ -1074,10 +1074,11 @@ int ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev, __u8 dsfield,
memcpy(&fl6->daddr, addr6, sizeof(fl6->daddr)); memcpy(&fl6->daddr, addr6, sizeof(fl6->daddr));
neigh_release(neigh); 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))) { (IP6_TNL_F_USE_ORIG_TCLASS |
/* enable the cache only only if the routing decision does IP6_TNL_F_USE_ORIG_FWMARK))) {
* 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; use_cache = true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment