]> git.baikalelectronics.ru Git - kernel.git/commit
sctp: only allow the out stream reset when the stream outq is empty
authorXin Long <lucien.xin@gmail.com>
Sat, 25 Nov 2017 13:05:33 +0000 (21:05 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 Nov 2017 15:38:45 +0000 (00:38 +0900)
commit20cc59cd95df4fb1be60d24e12f55f026cac2a52
tree05de6eecbd673697e82e6dbaa6fd256384a8cb3d
parent1cc044dac43798d196bde8ba41c208346d22e650
sctp: only allow the out stream reset when the stream outq is empty

Now the out stream reset in sctp stream reconf could be done even if
the stream outq is not empty. It means that users can not be sure
since which msg the new ssn will be used.

To make this more synchronous, it shouldn't allow to do out stream
reset until these chunks in unsent outq all are sent out.

This patch checks the corresponding stream outqs when sending and
processing the request . If any of them has unsent chunks in outq,
it will return -EAGAIN instead or send SCTP_STRRESET_IN_PROGRESS
back to the sender.

Fixes: f3e3c6e55694 ("sctp: implement sender-side procedures for SSN Reset Request Parameter")
Suggested-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/stream.c