]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/ipv4/icmp.c
icmp: Account for ICMP out errors
[net-next-2.6.git] / net / ipv4 / icmp.c
index fe11f60ce41ba645d7f9535e13524419f16dff90..d2aa7438c52366e864ece0d65fe970a02584ae17 100644 (file)
@@ -114,7 +114,7 @@ struct icmp_bxm {
 /* An array of errno for error messages from dest unreach. */
 /* RFC 1122: 3.2.2.1 States that NET_UNREACH, HOST_UNREACH and SR_FAILED MUST be considered 'transient errs'. */
 
-struct icmp_err icmp_err_convert[] = {
+const struct icmp_err icmp_err_convert[] = {
        {
                .errno = ENETUNREACH,   /* ICMP_NET_UNREACH */
                .fatal = 0,
@@ -330,9 +330,10 @@ static void icmp_push_reply(struct icmp_bxm *icmp_param,
        if (ip_append_data(sk, icmp_glue_bits, icmp_param,
                           icmp_param->data_len+icmp_param->head_len,
                           icmp_param->head_len,
-                          ipc, rt, MSG_DONTWAIT) < 0)
+                          ipc, rt, MSG_DONTWAIT) < 0) {
+               ICMP_INC_STATS_BH(sock_net(sk), ICMP_MIB_OUTERRORS);
                ip_flush_pending_frames(sk);
-       else if ((skb = skb_peek(&sk->sk_write_queue)) != NULL) {
+       else if ((skb = skb_peek(&sk->sk_write_queue)) != NULL) {
                struct icmphdr *icmph = icmp_hdr(skb);
                __wsum csum = 0;
                struct sk_buff *skb1;