diff options
author | Xin Long <lucien.xin@gmail.com> | 2017-10-28 07:43:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-29 05:03:24 -0400 |
commit | f6fc6bc0b8e0bb13a210bd7386ffdcb1a5f30ef1 (patch) | |
tree | 26bd186e3cc30b231301f3853df53341092734fa /net | |
parent | 8d32503efde82db4e0a370981e90628ebd6718b5 (diff) |
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 d4d6fb5787a6 ("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: d4d6fb5787a6 ("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>
Diffstat (limited to 'net')
-rw-r--r-- | net/sctp/sm_sideeffect.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c index e6a2974e020e..8f2762bba879 100644 --- a/net/sctp/sm_sideeffect.c +++ b/net/sctp/sm_sideeffect.c | |||
@@ -1680,8 +1680,8 @@ static int sctp_cmd_interpreter(enum sctp_event event_type, | |||
1680 | case SCTP_CMD_PROCESS_CTSN: | 1680 | case SCTP_CMD_PROCESS_CTSN: |
1681 | /* Dummy up a SACK for processing. */ | 1681 | /* Dummy up a SACK for processing. */ |
1682 | sackh.cum_tsn_ack = cmd->obj.be32; | 1682 | sackh.cum_tsn_ack = cmd->obj.be32; |
1683 | sackh.a_rwnd = asoc->peer.rwnd + | 1683 | sackh.a_rwnd = htonl(asoc->peer.rwnd + |
1684 | asoc->outqueue.outstanding_bytes; | 1684 | asoc->outqueue.outstanding_bytes); |
1685 | sackh.num_gap_ack_blocks = 0; | 1685 | sackh.num_gap_ack_blocks = 0; |
1686 | sackh.num_dup_tsns = 0; | 1686 | sackh.num_dup_tsns = 0; |
1687 | chunk->subh.sack_hdr = &sackh; | 1687 | chunk->subh.sack_hdr = &sackh; |