diff options
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/icmp.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index 092934032077..39b3ff97a504 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c | |||
@@ -679,6 +679,7 @@ static int icmpv6_rcv(struct sk_buff *skb) | |||
679 | const struct in6_addr *saddr, *daddr; | 679 | const struct in6_addr *saddr, *daddr; |
680 | struct icmp6hdr *hdr; | 680 | struct icmp6hdr *hdr; |
681 | u8 type; | 681 | u8 type; |
682 | bool success = false; | ||
682 | 683 | ||
683 | if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) { | 684 | if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) { |
684 | struct sec_path *sp = skb_sec_path(skb); | 685 | struct sec_path *sp = skb_sec_path(skb); |
@@ -726,7 +727,7 @@ static int icmpv6_rcv(struct sk_buff *skb) | |||
726 | break; | 727 | break; |
727 | 728 | ||
728 | case ICMPV6_ECHO_REPLY: | 729 | case ICMPV6_ECHO_REPLY: |
729 | ping_rcv(skb); | 730 | success = ping_rcv(skb); |
730 | break; | 731 | break; |
731 | 732 | ||
732 | case ICMPV6_PKT_TOOBIG: | 733 | case ICMPV6_PKT_TOOBIG: |
@@ -790,7 +791,14 @@ static int icmpv6_rcv(struct sk_buff *skb) | |||
790 | icmpv6_notify(skb, type, hdr->icmp6_code, hdr->icmp6_mtu); | 791 | icmpv6_notify(skb, type, hdr->icmp6_code, hdr->icmp6_mtu); |
791 | } | 792 | } |
792 | 793 | ||
793 | kfree_skb(skb); | 794 | /* until the v6 path can be better sorted assume failure and |
795 | * preserve the status quo behaviour for the rest of the paths to here | ||
796 | */ | ||
797 | if (success) | ||
798 | consume_skb(skb); | ||
799 | else | ||
800 | kfree_skb(skb); | ||
801 | |||
794 | return 0; | 802 | return 0; |
795 | 803 | ||
796 | csum_error: | 804 | csum_error: |