aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_output.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/ip_output.c')
-rw-r--r--net/ipv4/ip_output.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 7c9f9a6421b8..a2ede167e045 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -440,6 +440,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
440 iph = skb->nh.iph; 440 iph = skb->nh.iph;
441 441
442 if (unlikely((iph->frag_off & htons(IP_DF)) && !skb->local_df)) { 442 if (unlikely((iph->frag_off & htons(IP_DF)) && !skb->local_df)) {
443 IP_INC_STATS(IPSTATS_MIB_FRAGFAILS);
443 icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, 444 icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
444 htonl(dst_mtu(&rt->u.dst))); 445 htonl(dst_mtu(&rt->u.dst)));
445 kfree_skb(skb); 446 kfree_skb(skb);
@@ -526,6 +527,8 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
526 527
527 err = output(skb); 528 err = output(skb);
528 529
530 if (!err)
531 IP_INC_STATS(IPSTATS_MIB_FRAGCREATES);
529 if (err || !frag) 532 if (err || !frag)
530 break; 533 break;
531 534
@@ -649,9 +652,6 @@ slow_path:
649 /* 652 /*
650 * Put this fragment into the sending queue. 653 * Put this fragment into the sending queue.
651 */ 654 */
652
653 IP_INC_STATS(IPSTATS_MIB_FRAGCREATES);
654
655 iph->tot_len = htons(len + hlen); 655 iph->tot_len = htons(len + hlen);
656 656
657 ip_send_check(iph); 657 ip_send_check(iph);
@@ -659,6 +659,8 @@ slow_path:
659 err = output(skb2); 659 err = output(skb2);
660 if (err) 660 if (err)
661 goto fail; 661 goto fail;
662
663 IP_INC_STATS(IPSTATS_MIB_FRAGCREATES);
662 } 664 }
663 kfree_skb(skb); 665 kfree_skb(skb);
664 IP_INC_STATS(IPSTATS_MIB_FRAGOKS); 666 IP_INC_STATS(IPSTATS_MIB_FRAGOKS);
@@ -946,7 +948,7 @@ alloc_new_skb:
946 skb_prev->csum = csum_sub(skb_prev->csum, 948 skb_prev->csum = csum_sub(skb_prev->csum,
947 skb->csum); 949 skb->csum);
948 data += fraggap; 950 data += fraggap;
949 skb_trim(skb_prev, maxfraglen); 951 pskb_trim_unique(skb_prev, maxfraglen);
950 } 952 }
951 953
952 copy = datalen - transhdrlen - fraggap; 954 copy = datalen - transhdrlen - fraggap;
@@ -1141,7 +1143,7 @@ ssize_t ip_append_page(struct sock *sk, struct page *page,
1141 data, fraggap, 0); 1143 data, fraggap, 0);
1142 skb_prev->csum = csum_sub(skb_prev->csum, 1144 skb_prev->csum = csum_sub(skb_prev->csum,
1143 skb->csum); 1145 skb->csum);
1144 skb_trim(skb_prev, maxfraglen); 1146 pskb_trim_unique(skb_prev, maxfraglen);
1145 } 1147 }
1146 1148
1147 /* 1149 /*