sctp: count singleton chunks in assoc user stats
[linux-2.6-microblaze.git] / net / sctp / outqueue.c
index a18609f..e213aaf 100644 (file)
@@ -914,6 +914,7 @@ static void sctp_outq_flush_ctrl(struct sctp_flush_ctx *ctx)
                                ctx->asoc->base.sk->sk_err = -error;
                                return;
                        }
+                       ctx->asoc->stats.octrlchunks++;
                        break;
 
                case SCTP_CID_ABORT:
@@ -938,7 +939,10 @@ static void sctp_outq_flush_ctrl(struct sctp_flush_ctx *ctx)
 
                case SCTP_CID_HEARTBEAT:
                        if (chunk->pmtu_probe) {
-                               sctp_packet_singleton(ctx->transport, chunk, ctx->gfp);
+                               error = sctp_packet_singleton(ctx->transport,
+                                                             chunk, ctx->gfp);
+                               if (!error)
+                                       ctx->asoc->stats.octrlchunks++;
                                break;
                        }
                        fallthrough;