aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/sctp/structs.h2
-rw-r--r--net/sctp/sm_sideeffect.c17
-rw-r--r--net/sctp/transport.c2
3 files changed, 19 insertions, 2 deletions
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 9f70d54fcefc..23f08fe1d50a 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -910,8 +910,10 @@ struct sctp_transport {
910 * should be set. Every time the RTT 910 * should be set. Every time the RTT
911 * calculation completes (i.e. the DATA chunk 911 * calculation completes (i.e. the DATA chunk
912 * is SACK'd) clear this flag. 912 * is SACK'd) clear this flag.
913 * hb_sent : a flag that signals that we have a pending heartbeat.
913 */ 914 */
914 __u8 rto_pending; 915 __u8 rto_pending;
916 __u8 hb_sent;
915 917
916 /* Flag to track the current fast recovery state */ 918 /* Flag to track the current fast recovery state */
917 __u8 fast_recovery; 919 __u8 fast_recovery;
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index e1d6076b4f59..0146cfb1f182 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -461,9 +461,15 @@ static void sctp_do_8_2_transport_strike(struct sctp_association *asoc,
461 * expires, set RTO <- RTO * 2 ("back off the timer"). The 461 * expires, set RTO <- RTO * 2 ("back off the timer"). The
462 * maximum value discussed in rule C7 above (RTO.max) may be 462 * maximum value discussed in rule C7 above (RTO.max) may be
463 * used to provide an upper bound to this doubling operation. 463 * used to provide an upper bound to this doubling operation.
464 *
465 * Special Case: the first HB doesn't trigger exponential backoff.
466 * The first unacknowleged HB triggers it. We do this with a flag
467 * that indicates that we have an outstanding HB.
464 */ 468 */
465 transport->last_rto = transport->rto; 469 if (transport->hb_sent) {
466 transport->rto = min((transport->rto * 2), transport->asoc->rto_max); 470 transport->last_rto = transport->rto;
471 transport->rto = min((transport->rto * 2), transport->asoc->rto_max);
472 }
467} 473}
468 474
469/* Worker routine to handle INIT command failure. */ 475/* Worker routine to handle INIT command failure. */
@@ -621,6 +627,11 @@ static void sctp_cmd_transport_on(sctp_cmd_seq_t *cmds,
621 t->error_count = 0; 627 t->error_count = 0;
622 t->asoc->overall_error_count = 0; 628 t->asoc->overall_error_count = 0;
623 629
630 /* Clear the hb_sent flag to signal that we had a good
631 * acknowledgement.
632 */
633 t->hb_sent = 0;
634
624 /* Mark the destination transport address as active if it is not so 635 /* Mark the destination transport address as active if it is not so
625 * marked. 636 * marked.
626 */ 637 */
@@ -657,6 +668,8 @@ static void sctp_cmd_transport_reset(sctp_cmd_seq_t *cmds,
657 668
658 /* Mark one strike against a transport. */ 669 /* Mark one strike against a transport. */
659 sctp_do_8_2_transport_strike(asoc, t); 670 sctp_do_8_2_transport_strike(asoc, t);
671
672 t->hb_sent = 1;
660} 673}
661 674
662/* Helper function to process the process SACK command. */ 675/* Helper function to process the process SACK command. */
diff --git a/net/sctp/transport.c b/net/sctp/transport.c
index e745c118f239..5c29b14ee9af 100644
--- a/net/sctp/transport.c
+++ b/net/sctp/transport.c
@@ -79,6 +79,7 @@ static struct sctp_transport *sctp_transport_init(struct sctp_transport *peer,
79 peer->rttvar = 0; 79 peer->rttvar = 0;
80 peer->srtt = 0; 80 peer->srtt = 0;
81 peer->rto_pending = 0; 81 peer->rto_pending = 0;
82 peer->hb_sent = 0;
82 peer->fast_recovery = 0; 83 peer->fast_recovery = 0;
83 84
84 peer->last_time_heard = jiffies; 85 peer->last_time_heard = jiffies;
@@ -608,6 +609,7 @@ void sctp_transport_reset(struct sctp_transport *t)
608 t->flight_size = 0; 609 t->flight_size = 0;
609 t->error_count = 0; 610 t->error_count = 0;
610 t->rto_pending = 0; 611 t->rto_pending = 0;
612 t->hb_sent = 0;
611 t->fast_recovery = 0; 613 t->fast_recovery = 0;
612 614
613 /* Initialize the state information for SFR-CACC */ 615 /* Initialize the state information for SFR-CACC */