aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>2018-06-20 11:47:52 -0400
committerDavid S. Miller <davem@davemloft.net>2018-06-20 23:49:33 -0400
commitfedb1bd3d274b33c432cb83c80c6b3cf54d509c8 (patch)
tree4a9114717845d1a3e835cdc386b80ceee4c13e36
parent9262478220eac908ae6e168c3df2c453c87e2da3 (diff)
sctp: fix erroneous inc of snmp SctpFragUsrMsgs
Currently it is incrementing SctpFragUsrMsgs when the user message size is of the exactly same size as the maximum fragment size, which is wrong. The fix is to increment it only when user message is bigger than the maximum fragment size. Fixes: bfd2e4b8734d ("sctp: refactor sctp_datamsg_from_user") Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Acked-by: Neil Horman <nhorman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/sctp/chunk.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c
index 79daa98208c3..bfb9f812e2ef 100644
--- a/net/sctp/chunk.c
+++ b/net/sctp/chunk.c
@@ -237,7 +237,9 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,
237 /* Account for a different sized first fragment */ 237 /* Account for a different sized first fragment */
238 if (msg_len >= first_len) { 238 if (msg_len >= first_len) {
239 msg->can_delay = 0; 239 msg->can_delay = 0;
240 SCTP_INC_STATS(sock_net(asoc->base.sk), SCTP_MIB_FRAGUSRMSGS); 240 if (msg_len > first_len)
241 SCTP_INC_STATS(sock_net(asoc->base.sk),
242 SCTP_MIB_FRAGUSRMSGS);
241 } else { 243 } else {
242 /* Which may be the only one... */ 244 /* Which may be the only one... */
243 first_len = msg_len; 245 first_len = msg_len;