netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] sctp: start t5 timer only when peer.rwnd == 0 and in SHUTDOWN_PENDING
@ 2015-08-19  4:39 Xin Long
  2015-08-19 17:49 ` Marcelo Ricardo Leitner
  0 siblings, 1 reply; 2+ messages in thread
From: Xin Long @ 2015-08-19  4:39 UTC (permalink / raw)
  To: network dev; +Cc: mleitner, tgraf, davem

when A send a data to B, A close() to be in SHUTDOWN_PENDING state,
but B neither claim his rwnd is 0 nor SACK this data, then A keep
retransmiting this data. it should send abord after Max.Retrans
times, only when peer.rwnd == 0 and more than Max.Retrans times, it
will start t5 timer.

Fixes: f8d960524 ("sctp: Enforce retransmission limit during shutdown")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
 net/sctp/sm_statefuns.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 3ee27b7..7d9380c 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -5412,7 +5412,8 @@ sctp_disposition_t sctp_sf_do_6_3_3_rtx(struct net *net,
 	SCTP_INC_STATS(net, SCTP_MIB_T3_RTX_EXPIREDS);
 
 	if (asoc->overall_error_count >= asoc->max_retrans) {
-		if (asoc->state == SCTP_STATE_SHUTDOWN_PENDING) {
+		if (!q->asoc->peer.rwnd &&
+			asoc->state == SCTP_STATE_SHUTDOWN_PENDING) {
 			/*
 			 * We are here likely because the receiver had its rwnd
 			 * closed for a while and we have not been able to
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] sctp: start t5 timer only when peer.rwnd == 0 and in SHUTDOWN_PENDING
  2015-08-19  4:39 [PATCH net] sctp: start t5 timer only when peer.rwnd == 0 and in SHUTDOWN_PENDING Xin Long
@ 2015-08-19 17:49 ` Marcelo Ricardo Leitner
  0 siblings, 0 replies; 2+ messages in thread
From: Marcelo Ricardo Leitner @ 2015-08-19 17:49 UTC (permalink / raw)
  To: Xin Long; +Cc: network dev, tgraf, davem

On Wed, Aug 19, 2015 at 12:39:06PM +0800, Xin Long wrote:
> when A send a data to B, A close() to be in SHUTDOWN_PENDING state,
> but B neither claim his rwnd is 0 nor SACK this data, then A keep
> retransmiting this data. it should send abord after Max.Retrans
> times, only when peer.rwnd == 0 and more than Max.Retrans times, it
> will start t5 timer.
> 
> Fixes: f8d960524 ("sctp: Enforce retransmission limit during shutdown")
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
> ---

changelog is confusing, please reword it, specially the last part.

>  net/sctp/sm_statefuns.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
> index 3ee27b7..7d9380c 100644
> --- a/net/sctp/sm_statefuns.c
> +++ b/net/sctp/sm_statefuns.c
> @@ -5412,7 +5412,8 @@ sctp_disposition_t sctp_sf_do_6_3_3_rtx(struct net *net,
>  	SCTP_INC_STATS(net, SCTP_MIB_T3_RTX_EXPIREDS);
>  
>  	if (asoc->overall_error_count >= asoc->max_retrans) {
> -		if (asoc->state == SCTP_STATE_SHUTDOWN_PENDING) {
> +		if (!q->asoc->peer.rwnd &&
> +			asoc->state == SCTP_STATE_SHUTDOWN_PENDING) {
                    ^

Indentation issue here. 2nd if line should start where I marked.

Other than that, looks good to me.

>  			/*
>  			 * We are here likely because the receiver had its rwnd
>  			 * closed for a while and we have not been able to
> -- 
> 2.1.0
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-08-19 17:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-19  4:39 [PATCH net] sctp: start t5 timer only when peer.rwnd == 0 and in SHUTDOWN_PENDING Xin Long
2015-08-19 17:49 ` Marcelo Ricardo Leitner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).