Skip to content

Commit

Permalink
sctp: fix stream update when processing dupcookie
Browse files Browse the repository at this point in the history
Since commit 3dbcc10 ("sctp: alloc stream info when initializing
asoc"), stream and stream.out info are always alloced when creating
an asoc.

So it's not correct to check !asoc->stream before updating stream
info when processing dupcookie, but would be better to check asoc
state instead.

Fixes: 3dbcc10 ("sctp: alloc stream info when initializing asoc")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Xin Long authored and David S. Miller committed May 24, 2017
1 parent 12e8b57 commit 3ab2137
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/sctp/associola.c
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,9 @@ void sctp_assoc_update(struct sctp_association *asoc,

asoc->ctsn_ack_point = asoc->next_tsn - 1;
asoc->adv_peer_ack_point = asoc->ctsn_ack_point;
if (!asoc->stream) {

if (sctp_state(asoc, COOKIE_WAIT)) {
sctp_stream_free(asoc->stream);
asoc->stream = new->stream;
new->stream = NULL;
}
Expand Down

0 comments on commit 3ab2137

Please sign in to comment.