diff options
Diffstat (limited to 'net/sctp/transport.c')
-rw-r--r-- | net/sctp/transport.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/sctp/transport.c b/net/sctp/transport.c index e745c118f239..e5dde45c79d3 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; |
@@ -542,8 +543,8 @@ void sctp_transport_lower_cwnd(struct sctp_transport *transport, | |||
542 | * congestion indications more than once every window of | 543 | * congestion indications more than once every window of |
543 | * data (or more loosely more than once every round-trip time). | 544 | * data (or more loosely more than once every round-trip time). |
544 | */ | 545 | */ |
545 | if ((jiffies - transport->last_time_ecne_reduced) > | 546 | if (time_after(jiffies, transport->last_time_ecne_reduced + |
546 | transport->rtt) { | 547 | transport->rtt)) { |
547 | transport->ssthresh = max(transport->cwnd/2, | 548 | transport->ssthresh = max(transport->cwnd/2, |
548 | 4*transport->asoc->pathmtu); | 549 | 4*transport->asoc->pathmtu); |
549 | transport->cwnd = transport->ssthresh; | 550 | transport->cwnd = transport->ssthresh; |
@@ -560,7 +561,8 @@ void sctp_transport_lower_cwnd(struct sctp_transport *transport, | |||
560 | * to be done every RTO interval, we do it every hearbeat | 561 | * to be done every RTO interval, we do it every hearbeat |
561 | * interval. | 562 | * interval. |
562 | */ | 563 | */ |
563 | if ((jiffies - transport->last_time_used) > transport->rto) | 564 | if (time_after(jiffies, transport->last_time_used + |
565 | transport->rto)) | ||
564 | transport->cwnd = max(transport->cwnd/2, | 566 | transport->cwnd = max(transport->cwnd/2, |
565 | 4*transport->asoc->pathmtu); | 567 | 4*transport->asoc->pathmtu); |
566 | break; | 568 | break; |
@@ -608,6 +610,7 @@ void sctp_transport_reset(struct sctp_transport *t) | |||
608 | t->flight_size = 0; | 610 | t->flight_size = 0; |
609 | t->error_count = 0; | 611 | t->error_count = 0; |
610 | t->rto_pending = 0; | 612 | t->rto_pending = 0; |
613 | t->hb_sent = 0; | ||
611 | t->fast_recovery = 0; | 614 | t->fast_recovery = 0; |
612 | 615 | ||
613 | /* Initialize the state information for SFR-CACC */ | 616 | /* Initialize the state information for SFR-CACC */ |