aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/icmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/icmp.c')
-rw-r--r--net/ipv4/icmp.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index efc7cbe759c9..3e14d9cd29b3 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -578,7 +578,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
578 } 578 }
579 579
580 if (xfrm_decode_session_reverse(skb_in, &fl, AF_INET)) 580 if (xfrm_decode_session_reverse(skb_in, &fl, AF_INET))
581 goto ende; 581 goto relookup_failed;
582 582
583 if (inet_addr_type(net, fl.fl4_src) == RTN_LOCAL) 583 if (inet_addr_type(net, fl.fl4_src) == RTN_LOCAL)
584 err = __ip_route_output_key(net, &rt2, &fl); 584 err = __ip_route_output_key(net, &rt2, &fl);
@@ -588,7 +588,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
588 588
589 fl2.fl4_dst = fl.fl4_src; 589 fl2.fl4_dst = fl.fl4_src;
590 if (ip_route_output_key(net, &rt2, &fl2)) 590 if (ip_route_output_key(net, &rt2, &fl2))
591 goto ende; 591 goto relookup_failed;
592 592
593 /* Ugh! */ 593 /* Ugh! */
594 odst = skb_in->dst; 594 odst = skb_in->dst;
@@ -601,21 +601,23 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
601 } 601 }
602 602
603 if (err) 603 if (err)
604 goto ende; 604 goto relookup_failed;
605 605
606 err = xfrm_lookup((struct dst_entry **)&rt2, &fl, NULL, 606 err = xfrm_lookup((struct dst_entry **)&rt2, &fl, NULL,
607 XFRM_LOOKUP_ICMP); 607 XFRM_LOOKUP_ICMP);
608 if (err == -ENOENT) { 608 switch (err) {
609 case 0:
610 dst_release(&rt->u.dst);
611 rt = rt2;
612 break;
613 case -EPERM:
614 goto ende;
615 default:
616relookup_failed:
609 if (!rt) 617 if (!rt)
610 goto out_unlock; 618 goto out_unlock;
611 goto route_done; 619 break;
612 } 620 }
613
614 dst_release(&rt->u.dst);
615 rt = rt2;
616
617 if (err)
618 goto out_unlock;
619 } 621 }
620 622
621route_done: 623route_done: