diff options
Diffstat (limited to 'net/sctp/transport.c')
| -rw-r--r-- | net/sctp/transport.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/net/sctp/transport.c b/net/sctp/transport.c index a596f5308cb1..4d8c2ab864fc 100644 --- a/net/sctp/transport.c +++ b/net/sctp/transport.c | |||
| @@ -526,3 +526,35 @@ unsigned long sctp_transport_timeout(struct sctp_transport *t) | |||
| 526 | timeout += jiffies; | 526 | timeout += jiffies; |
| 527 | return timeout; | 527 | return timeout; |
| 528 | } | 528 | } |
| 529 | |||
| 530 | /* Reset transport variables to their initial values */ | ||
| 531 | void sctp_transport_reset(struct sctp_transport *t) | ||
| 532 | { | ||
| 533 | struct sctp_association *asoc = t->asoc; | ||
| 534 | |||
| 535 | /* RFC 2960 (bis), Section 5.2.4 | ||
| 536 | * All the congestion control parameters (e.g., cwnd, ssthresh) | ||
| 537 | * related to this peer MUST be reset to their initial values | ||
| 538 | * (see Section 6.2.1) | ||
| 539 | */ | ||
| 540 | t->cwnd = min(4*asoc->pathmtu, max_t(__u32, 2*asoc->pathmtu, 4380)); | ||
| 541 | t->ssthresh = asoc->peer.i.a_rwnd; | ||
| 542 | t->rto = asoc->rto_initial; | ||
| 543 | t->rtt = 0; | ||
| 544 | t->srtt = 0; | ||
| 545 | t->rttvar = 0; | ||
| 546 | |||
| 547 | /* Reset these additional varibles so that we have a clean | ||
| 548 | * slate. | ||
| 549 | */ | ||
| 550 | t->partial_bytes_acked = 0; | ||
| 551 | t->flight_size = 0; | ||
| 552 | t->error_count = 0; | ||
| 553 | t->rto_pending = 0; | ||
| 554 | |||
| 555 | /* Initialize the state information for SFR-CACC */ | ||
| 556 | t->cacc.changeover_active = 0; | ||
| 557 | t->cacc.cycling_changeover = 0; | ||
| 558 | t->cacc.next_tsn_at_change = 0; | ||
| 559 | t->cacc.cacc_saw_newack = 0; | ||
| 560 | } | ||
