ip6_tunnel: disable dst caching if tunnel is dual-stack
[ Upstream commit 23263ec86a5f44312d2899323872468752324107 ] 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: Eli Cooper <elicooper@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
0e1cadec41
commit
b9f16497ee
1 changed files with 5 additions and 4 deletions
|
@ -1083,10 +1083,11 @@ static int ip6_tnl_xmit2(struct sk_buff *skb,
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue