aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/reassembly.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 2eeadfa039cb..f4f62f086096 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -578,19 +578,12 @@ static int ipv6_frag_rcv(struct sk_buff *skb)
578 IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_REASMREQDS); 578 IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_REASMREQDS);
579 579
580 /* Jumbo payload inhibits frag. header */ 580 /* Jumbo payload inhibits frag. header */
581 if (hdr->payload_len==0) { 581 if (hdr->payload_len==0)
582 IP6_INC_STATS(ip6_dst_idev(skb->dst), IPSTATS_MIB_INHDRERRORS); 582 goto fail_hdr;
583 icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, 583
584 skb_network_header_len(skb));
585 return -1;
586 }
587 if (!pskb_may_pull(skb, (skb_transport_offset(skb) + 584 if (!pskb_may_pull(skb, (skb_transport_offset(skb) +
588 sizeof(struct frag_hdr)))) { 585 sizeof(struct frag_hdr))))
589 IP6_INC_STATS(ip6_dst_idev(skb->dst), IPSTATS_MIB_INHDRERRORS); 586 goto fail_hdr;
590 icmpv6_param_prob(skb, ICMPV6_HDR_FIELD,
591 skb_network_header_len(skb));
592 return -1;
593 }
594 587
595 hdr = ipv6_hdr(skb); 588 hdr = ipv6_hdr(skb);
596 fhdr = (struct frag_hdr *)skb_transport_header(skb); 589 fhdr = (struct frag_hdr *)skb_transport_header(skb);
@@ -624,6 +617,11 @@ static int ipv6_frag_rcv(struct sk_buff *skb)
624 IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_REASMFAILS); 617 IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_REASMFAILS);
625 kfree_skb(skb); 618 kfree_skb(skb);
626 return -1; 619 return -1;
620
621fail_hdr:
622 IP6_INC_STATS(ip6_dst_idev(skb->dst), IPSTATS_MIB_INHDRERRORS);
623 icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, skb_network_header_len(skb));
624 return -1;
627} 625}
628 626
629static struct inet6_protocol frag_protocol = 627static struct inet6_protocol frag_protocol =