aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/icmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/icmp.c')
-rw-r--r--net/ipv6/icmp.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 195086114e63..d42dd16d3487 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -441,24 +441,26 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info,
441 } 441 }
442 442
443 if (xfrm_decode_session_reverse(skb, &fl2, AF_INET6)) 443 if (xfrm_decode_session_reverse(skb, &fl2, AF_INET6))
444 goto out_dst_release; 444 goto relookup_failed;
445 445
446 if (ip6_dst_lookup(sk, &dst2, &fl)) 446 if (ip6_dst_lookup(sk, &dst2, &fl))
447 goto out_dst_release; 447 goto relookup_failed;
448 448
449 err = xfrm_lookup(&dst2, &fl, sk, XFRM_LOOKUP_ICMP); 449 err = xfrm_lookup(&dst2, &fl, sk, XFRM_LOOKUP_ICMP);
450 if (err == -ENOENT) { 450 switch (err) {
451 case 0:
452 dst_release(dst);
453 dst = dst2;
454 break;
455 case -EPERM:
456 goto out_dst_release;
457 default:
458relookup_failed:
451 if (!dst) 459 if (!dst)
452 goto out; 460 goto out;
453 goto route_done; 461 break;
454 } 462 }
455 463
456 dst_release(dst);
457 dst = dst2;
458
459 if (err)
460 goto out;
461
462route_done: 464route_done:
463 if (ipv6_addr_is_multicast(&fl.fl6_dst)) 465 if (ipv6_addr_is_multicast(&fl.fl6_dst))
464 hlimit = np->mcast_hops; 466 hlimit = np->mcast_hops;