aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/netfilter.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-02 13:27:41 -0800
committerDavid S. Miller <davem@davemloft.net>2011-03-02 13:27:41 -0800
commit452edd598f60522c11f7f88fdbab27eb36509d1a (patch)
treedf1510e9848e591a412c8bfa724253470c48c4c2 /net/ipv4/netfilter.c
parentMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6 (diff)
downloadlinux-dev-452edd598f60522c11f7f88fdbab27eb36509d1a.tar.xz
linux-dev-452edd598f60522c11f7f88fdbab27eb36509d1a.zip
xfrm: Return dst directly from xfrm_lookup()
Instead of on the stack. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/netfilter.c')
-rw-r--r--net/ipv4/netfilter.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv4/netfilter.c b/net/ipv4/netfilter.c
index 994a1f29ebbc..9770bb427952 100644
--- a/net/ipv4/netfilter.c
+++ b/net/ipv4/netfilter.c
@@ -69,7 +69,8 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type)
xfrm_decode_session(skb, &fl, AF_INET) == 0) {
struct dst_entry *dst = skb_dst(skb);
skb_dst_set(skb, NULL);
- if (xfrm_lookup(net, &dst, &fl, skb->sk, 0))
+ dst = xfrm_lookup(net, dst, &fl, skb->sk, 0);
+ if (IS_ERR(dst))
return -1;
skb_dst_set(skb, dst);
}
@@ -102,7 +103,8 @@ int ip_xfrm_me_harder(struct sk_buff *skb)
dst = ((struct xfrm_dst *)dst)->route;
dst_hold(dst);
- if (xfrm_lookup(dev_net(dst->dev), &dst, &fl, skb->sk, 0) < 0)
+ dst = xfrm_lookup(dev_net(dst->dev), dst, &fl, skb->sk, 0);
+ if (IS_ERR(dst))
return -1;
skb_dst_drop(skb);