[IPV6]: Fix ICMP relookup error path dst leak
authorHerbert Xu <herbert@gondor.apana.org.au>
Wed, 2 Apr 2008 07:06:09 +0000 (00:06 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Apr 2008 07:06:09 +0000 (00:06 -0700)
When we encounter an error while looking up the dst the second
time we need to drop the first dst.  This patch is pretty much
the same as the one for IPv4.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/icmp.c

index 121d517bf91c9d16467c5aa85df47efdd0b6c58e..f204a7275a0d0e1e740d64f713d7d3d28cda9b78 100644 (file)
@@ -436,10 +436,10 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info,
        }
 
        if (xfrm_decode_session_reverse(skb, &fl2, AF_INET6))
-               goto out;
+               goto out_dst_release;
 
        if (ip6_dst_lookup(sk, &dst2, &fl))
-               goto out;
+               goto out_dst_release;
 
        err = xfrm_lookup(&dst2, &fl, sk, XFRM_LOOKUP_ICMP);
        if (err == -ENOENT) {