diff options
Diffstat (limited to 'net/ipv4/icmp.c')
-rw-r--r-- | net/ipv4/icmp.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 279f57abfecb..24eb56ae1b5a 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c | |||
@@ -114,7 +114,7 @@ struct icmp_bxm { | |||
114 | /* | 114 | /* |
115 | * Statistics | 115 | * Statistics |
116 | */ | 116 | */ |
117 | DEFINE_SNMP_STAT(struct icmp_mib, icmp_statistics); | 117 | DEFINE_SNMP_STAT(struct icmp_mib, icmp_statistics) __read_mostly; |
118 | 118 | ||
119 | /* An array of errno for error messages from dest unreach. */ | 119 | /* An array of errno for error messages from dest unreach. */ |
120 | /* RFC 1122: 3.2.2.1 States that NET_UNREACH, HOST_UNREACH and SR_FAILED MUST be considered 'transient errs'. */ | 120 | /* RFC 1122: 3.2.2.1 States that NET_UNREACH, HOST_UNREACH and SR_FAILED MUST be considered 'transient errs'. */ |
@@ -349,12 +349,12 @@ static void icmp_push_reply(struct icmp_bxm *icmp_param, | |||
349 | { | 349 | { |
350 | struct sk_buff *skb; | 350 | struct sk_buff *skb; |
351 | 351 | ||
352 | ip_append_data(icmp_socket->sk, icmp_glue_bits, icmp_param, | 352 | if (ip_append_data(icmp_socket->sk, icmp_glue_bits, icmp_param, |
353 | icmp_param->data_len+icmp_param->head_len, | 353 | icmp_param->data_len+icmp_param->head_len, |
354 | icmp_param->head_len, | 354 | icmp_param->head_len, |
355 | ipc, rt, MSG_DONTWAIT); | 355 | ipc, rt, MSG_DONTWAIT) < 0) |
356 | 356 | ip_flush_pending_frames(icmp_socket->sk); | |
357 | if ((skb = skb_peek(&icmp_socket->sk->sk_write_queue)) != NULL) { | 357 | else if ((skb = skb_peek(&icmp_socket->sk->sk_write_queue)) != NULL) { |
358 | struct icmphdr *icmph = skb->h.icmph; | 358 | struct icmphdr *icmph = skb->h.icmph; |
359 | unsigned int csum = 0; | 359 | unsigned int csum = 0; |
360 | struct sk_buff *skb1; | 360 | struct sk_buff *skb1; |
@@ -627,11 +627,10 @@ static void icmp_unreach(struct sk_buff *skb) | |||
627 | break; | 627 | break; |
628 | case ICMP_FRAG_NEEDED: | 628 | case ICMP_FRAG_NEEDED: |
629 | if (ipv4_config.no_pmtu_disc) { | 629 | if (ipv4_config.no_pmtu_disc) { |
630 | LIMIT_NETDEBUG( | 630 | LIMIT_NETDEBUG(KERN_INFO "ICMP: %u.%u.%u.%u: " |
631 | printk(KERN_INFO "ICMP: %u.%u.%u.%u: " | ||
632 | "fragmentation needed " | 631 | "fragmentation needed " |
633 | "and DF set.\n", | 632 | "and DF set.\n", |
634 | NIPQUAD(iph->daddr))); | 633 | NIPQUAD(iph->daddr)); |
635 | } else { | 634 | } else { |
636 | info = ip_rt_frag_needed(iph, | 635 | info = ip_rt_frag_needed(iph, |
637 | ntohs(icmph->un.frag.mtu)); | 636 | ntohs(icmph->un.frag.mtu)); |
@@ -640,10 +639,9 @@ static void icmp_unreach(struct sk_buff *skb) | |||
640 | } | 639 | } |
641 | break; | 640 | break; |
642 | case ICMP_SR_FAILED: | 641 | case ICMP_SR_FAILED: |
643 | LIMIT_NETDEBUG( | 642 | LIMIT_NETDEBUG(KERN_INFO "ICMP: %u.%u.%u.%u: Source " |
644 | printk(KERN_INFO "ICMP: %u.%u.%u.%u: Source " | ||
645 | "Route Failed.\n", | 643 | "Route Failed.\n", |
646 | NIPQUAD(iph->daddr))); | 644 | NIPQUAD(iph->daddr)); |
647 | break; | 645 | break; |
648 | default: | 646 | default: |
649 | break; | 647 | break; |
@@ -936,8 +934,7 @@ int icmp_rcv(struct sk_buff *skb) | |||
936 | case CHECKSUM_HW: | 934 | case CHECKSUM_HW: |
937 | if (!(u16)csum_fold(skb->csum)) | 935 | if (!(u16)csum_fold(skb->csum)) |
938 | break; | 936 | break; |
939 | NETDEBUG(if (net_ratelimit()) | 937 | LIMIT_NETDEBUG(KERN_DEBUG "icmp v4 hw csum failure\n"); |
940 | printk(KERN_DEBUG "icmp v4 hw csum failure\n")); | ||
941 | case CHECKSUM_NONE: | 938 | case CHECKSUM_NONE: |
942 | if ((u16)csum_fold(skb_checksum(skb, 0, skb->len, 0))) | 939 | if ((u16)csum_fold(skb_checksum(skb, 0, skb->len, 0))) |
943 | goto error; | 940 | goto error; |