sctp: fix a type cast warnings that causes a_rwnd gets the wrong value

commit f6fc6bc0b8e0bb13a210bd7386ffdcb1a5f30ef1 upstream.

These warnings were found by running 'make C=2 M=net/sctp/'.

Commit d4d6fb5787 ("sctp: Try not to change a_rwnd when faking a
SACK from SHUTDOWN.") expected to use the peers old rwnd and add
our flight size to the a_rwnd. But with the wrong Endian, it may
not work as well as expected.

So fix it by converting to the right value.

Fixes: d4d6fb5787 ("sctp: Try not to change a_rwnd when faking a SACK from SHUTDOWN.")
Reported-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
Xin Long 2017-10-28 19:43:56 +08:00 committed by syphyr
parent 122bb12523
commit 8e90e181f1
1 changed files with 2 additions and 2 deletions

View File

@ -1648,8 +1648,8 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
case SCTP_CMD_PROCESS_CTSN:
/* Dummy up a SACK for processing. */
sackh.cum_tsn_ack = cmd->obj.be32;
sackh.a_rwnd = asoc->peer.rwnd +
asoc->outqueue.outstanding_bytes;
sackh.a_rwnd = htonl(asoc->peer.rwnd +
asoc->outqueue.outstanding_bytes);
sackh.num_gap_ack_blocks = 0;
sackh.num_dup_tsns = 0;
chunk->subh.sack_hdr = &sackh;