aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/reassembly.c
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-10-08 13:31:44 -0400
committerDavid S. Miller <davem@davemloft.net>2008-10-08 13:53:30 -0400
commit98b3377ca77a06a7bd75a444e9f7136e9bb5112e (patch)
tree505224cfdd8791099c75b346df39e3a19e35a1a3 /net/ipv6/reassembly.c
parent0b0588d42b2774734b51525fe6550d77f8ea9bc0 (diff)
ipv6: consolidate error paths in ipv6_frag_rcv
Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/reassembly.c')
-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 =