xfrm: Return dst directly from xfrm_lookup()

Instead of on the stack.

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller
2011-03-02 13:27:41 -08:00
parent 3872b28408
commit 452edd598f
14 changed files with 111 additions and 89 deletions

View File

@ -218,8 +218,13 @@ __ip_vs_route_output_v6(struct net *net, struct in6_addr *daddr,
ipv6_dev_get_saddr(net, ip6_dst_idev(dst)->dev,
&fl.fl6_dst, 0, &fl.fl6_src) < 0)
goto out_err;
if (do_xfrm && xfrm_lookup(net, &dst, &fl, NULL, 0) < 0)
goto out_err;
if (do_xfrm) {
dst = xfrm_lookup(net, dst, &fl, NULL, 0);
if (IS_ERR(dst)) {
dst = NULL;
goto out_err;
}
}
ipv6_addr_copy(ret_saddr, &fl.fl6_src);
return dst;