Commit 98b3377c authored by Denis V. Lunev's avatar Denis V. Lunev Committed by David S. Miller

ipv6: consolidate error paths in ipv6_frag_rcv

Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0b0588d4
...@@ -578,19 +578,12 @@ static int ipv6_frag_rcv(struct sk_buff *skb) ...@@ -578,19 +578,12 @@ static int ipv6_frag_rcv(struct sk_buff *skb)
IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_REASMREQDS); IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_REASMREQDS);
/* Jumbo payload inhibits frag. header */ /* Jumbo payload inhibits frag. header */
if (hdr->payload_len==0) { if (hdr->payload_len==0)
IP6_INC_STATS(ip6_dst_idev(skb->dst), IPSTATS_MIB_INHDRERRORS); goto fail_hdr;
icmpv6_param_prob(skb, ICMPV6_HDR_FIELD,
skb_network_header_len(skb));
return -1;
}
if (!pskb_may_pull(skb, (skb_transport_offset(skb) + if (!pskb_may_pull(skb, (skb_transport_offset(skb) +
sizeof(struct frag_hdr)))) { sizeof(struct frag_hdr))))
IP6_INC_STATS(ip6_dst_idev(skb->dst), IPSTATS_MIB_INHDRERRORS); goto fail_hdr;
icmpv6_param_prob(skb, ICMPV6_HDR_FIELD,
skb_network_header_len(skb));
return -1;
}
hdr = ipv6_hdr(skb); hdr = ipv6_hdr(skb);
fhdr = (struct frag_hdr *)skb_transport_header(skb); fhdr = (struct frag_hdr *)skb_transport_header(skb);
...@@ -624,6 +617,11 @@ static int ipv6_frag_rcv(struct sk_buff *skb) ...@@ -624,6 +617,11 @@ static int ipv6_frag_rcv(struct sk_buff *skb)
IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_REASMFAILS); IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_REASMFAILS);
kfree_skb(skb); kfree_skb(skb);
return -1; return -1;
fail_hdr:
IP6_INC_STATS(ip6_dst_idev(skb->dst), IPSTATS_MIB_INHDRERRORS);
icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, skb_network_header_len(skb));
return -1;
} }
static struct inet6_protocol frag_protocol = static struct inet6_protocol frag_protocol =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment