Commit f6fc6bc0 authored by Xin Long's avatar Xin Long Committed by David S. Miller

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

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

Commit d4d6fb57 ("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: d4d6fb57 ("sctp: Try not to change a_rwnd when faking a SACK from SHUTDOWN.")
Reported-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8d32503e
...@@ -1680,8 +1680,8 @@ static int sctp_cmd_interpreter(enum sctp_event event_type, ...@@ -1680,8 +1680,8 @@ static int sctp_cmd_interpreter(enum sctp_event event_type,
case SCTP_CMD_PROCESS_CTSN: case SCTP_CMD_PROCESS_CTSN:
/* Dummy up a SACK for processing. */ /* Dummy up a SACK for processing. */
sackh.cum_tsn_ack = cmd->obj.be32; sackh.cum_tsn_ack = cmd->obj.be32;
sackh.a_rwnd = asoc->peer.rwnd + sackh.a_rwnd = htonl(asoc->peer.rwnd +
asoc->outqueue.outstanding_bytes; asoc->outqueue.outstanding_bytes);
sackh.num_gap_ack_blocks = 0; sackh.num_gap_ack_blocks = 0;
sackh.num_dup_tsns = 0; sackh.num_dup_tsns = 0;
chunk->subh.sack_hdr = &sackh; chunk->subh.sack_hdr = &sackh;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment