Skip to content

Commit

Permalink
[IPV6]: Fix ICMP relookup error path dst leak
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Apr 2, 2008
1 parent a22eb6f commit f32c5f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/ipv6/icmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit f32c5f2

Please sign in to comment.