Skip to content

Commit f6fc6bc

Browse files
lxindavem330
authored andcommitted
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 d4d6fb5 ("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: d4d6fb5 ("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>
1 parent 8d32503 commit f6fc6bc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

net/sctp/sm_sideeffect.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,8 +1680,8 @@ static int sctp_cmd_interpreter(enum sctp_event event_type,
16801680
case SCTP_CMD_PROCESS_CTSN:
16811681
/* Dummy up a SACK for processing. */
16821682
sackh.cum_tsn_ack = cmd->obj.be32;
1683-
sackh.a_rwnd = asoc->peer.rwnd +
1684-
asoc->outqueue.outstanding_bytes;
1683+
sackh.a_rwnd = htonl(asoc->peer.rwnd +
1684+
asoc->outqueue.outstanding_bytes);
16851685
sackh.num_gap_ack_blocks = 0;
16861686
sackh.num_dup_tsns = 0;
16871687
chunk->subh.sack_hdr = &sackh;

0 commit comments

Comments
 (0)