summaryrefslogtreecommitdiffstats
path: root/net/sctp/associola.c
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2017-05-23 07:28:54 +0200
committerDavid S. Miller <davem@davemloft.net>2017-05-24 21:21:04 +0200
commit3ab2137915aea0ce7b3ec02e0f260ecc0f1c289d (patch)
treec61ede11017fffa658fb9ec7d9e57587a4e6495b /net/sctp/associola.c
parentmlx5: fix bug reading rss_hash_type from CQE (diff)
downloadlinux-3ab2137915aea0ce7b3ec02e0f260ecc0f1c289d.tar.xz
linux-3ab2137915aea0ce7b3ec02e0f260ecc0f1c289d.zip
sctp: fix stream update when processing dupcookie
Since commit 3dbcc105d556 ("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: 3dbcc105d556 ("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>
Diffstat (limited to 'net/sctp/associola.c')
-rw-r--r--net/sctp/associola.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index a9708da28eb5..95238284c422 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -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;
}