sctp: count data bundling sack chunk for outctrlchunks
authorXin Long <lucien.xin@gmail.com>
Wed, 3 Jul 2019 10:20:20 +0000 (18:20 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 3 Jul 2019 18:41:24 +0000 (11:41 -0700)
Now all ctrl chunks are counted for asoc stats.octrlchunks and net
SCTP_MIB_OUTCTRLCHUNKS either after queuing up or bundling, other
than the chunk maked and bundled in sctp_packet_bundle_sack, which
caused 'outctrlchunks' not consistent with 'inctrlchunks' in peer.

This issue exists since very beginning, here to fix it by increasing
both net SCTP_MIB_OUTCTRLCHUNKS and asoc stats.octrlchunks when sack
chunk is maked and bundled in sctp_packet_bundle_sack.

Reported-by: Ja Ram Jeon <jajeon@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/output.c

index e0c27477788ddcb4abb9561cdd2c19632a45418c..dbda7e7927fd96f83c05b6a2c66fd27de24217a2 100644 (file)
@@ -282,6 +282,9 @@ static enum sctp_xmit sctp_packet_bundle_sack(struct sctp_packet *pkt,
                                        sctp_chunk_free(sack);
                                        goto out;
                                }
+                               SCTP_INC_STATS(sock_net(asoc->base.sk),
+                                              SCTP_MIB_OUTCTRLCHUNKS);
+                               asoc->stats.octrlchunks++;
                                asoc->peer.sack_needed = 0;
                                if (del_timer(timer))
                                        sctp_association_put(asoc);