Skip to content

Commit

Permalink
sctp: fix erroneous inc of snmp SctpFragUsrMsgs
Browse files Browse the repository at this point in the history
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: bfd2e4b ("sctp: refactor sctp_datamsg_from_user")
Signed-off-by: Marcelo Ricardo Leitner <[email protected]>
Acked-by: Neil Horman <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
marceloleitner authored and davem330 committed Jun 21, 2018
1 parent 9262478 commit fedb1bd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/sctp/chunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,
/* Account for a different sized first fragment */
if (msg_len >= first_len) {
msg->can_delay = 0;
SCTP_INC_STATS(sock_net(asoc->base.sk), SCTP_MIB_FRAGUSRMSGS);
if (msg_len > first_len)
SCTP_INC_STATS(sock_net(asoc->base.sk),
SCTP_MIB_FRAGUSRMSGS);
} else {
/* Which may be the only one... */
first_len = msg_len;
Expand Down

0 comments on commit fedb1bd

Please sign in to comment.