提交 4da3089f 编写于 作者: H Herbert Xu 提交者: David S. Miller

[IPSEC]: Use TOS when doing tunnel lookups

We should use the TOS because it's one of the routing keys.  It also
means that we update the correct routing cache entry when PMTU occurs.
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f8d0e3f1
...@@ -35,6 +35,7 @@ __xfrm4_find_bundle(struct flowi *fl, struct xfrm_policy *policy) ...@@ -35,6 +35,7 @@ __xfrm4_find_bundle(struct flowi *fl, struct xfrm_policy *policy)
if (xdst->u.rt.fl.oif == fl->oif && /*XXX*/ if (xdst->u.rt.fl.oif == fl->oif && /*XXX*/
xdst->u.rt.fl.fl4_dst == fl->fl4_dst && xdst->u.rt.fl.fl4_dst == fl->fl4_dst &&
xdst->u.rt.fl.fl4_src == fl->fl4_src && xdst->u.rt.fl.fl4_src == fl->fl4_src &&
xdst->u.rt.fl.fl4_tos == fl->fl4_tos &&
xfrm_bundle_ok(xdst, fl, AF_INET)) { xfrm_bundle_ok(xdst, fl, AF_INET)) {
dst_clone(dst); dst_clone(dst);
break; break;
...@@ -61,7 +62,8 @@ __xfrm4_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int ...@@ -61,7 +62,8 @@ __xfrm4_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
.nl_u = { .nl_u = {
.ip4_u = { .ip4_u = {
.saddr = local, .saddr = local,
.daddr = remote .daddr = remote,
.tos = fl->fl4_tos
} }
} }
}; };
...@@ -230,6 +232,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl) ...@@ -230,6 +232,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl)
fl->proto = iph->protocol; fl->proto = iph->protocol;
fl->fl4_dst = iph->daddr; fl->fl4_dst = iph->daddr;
fl->fl4_src = iph->saddr; fl->fl4_src = iph->saddr;
fl->fl4_tos = iph->tos;
} }
static inline int xfrm4_garbage_collect(void) static inline int xfrm4_garbage_collect(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册