Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Marcelo Ricardo Leitner and committed by
David S. Miller
fedb1bd3 92624782

+3 -1
+3 -1
net/sctp/chunk.c
··· 237 237 /* Account for a different sized first fragment */ 238 238 if (msg_len >= first_len) { 239 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 243 } else { 242 244 /* Which may be the only one... */ 243 245 first_len = msg_len;