Lines Matching +full:- +full:alt

1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
4 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
5 * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved.
6 * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved.
59 asoc->sent_queue_retran_cnt, in sctp_audit_retranmission_queue()
60 asoc->sent_queue_cnt); in sctp_audit_retranmission_queue()
61 asoc->sent_queue_retran_cnt = 0; in sctp_audit_retranmission_queue()
62 asoc->sent_queue_cnt = 0; in sctp_audit_retranmission_queue()
63 TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) { in sctp_audit_retranmission_queue()
64 if (chk->sent == SCTP_DATAGRAM_RESEND) { in sctp_audit_retranmission_queue()
65 sctp_ucount_incr(asoc->sent_queue_retran_cnt); in sctp_audit_retranmission_queue()
67 asoc->sent_queue_cnt++; in sctp_audit_retranmission_queue()
69 TAILQ_FOREACH(chk, &asoc->control_send_queue, sctp_next) { in sctp_audit_retranmission_queue()
70 if (chk->sent == SCTP_DATAGRAM_RESEND) { in sctp_audit_retranmission_queue()
71 sctp_ucount_incr(asoc->sent_queue_retran_cnt); in sctp_audit_retranmission_queue()
74 TAILQ_FOREACH(chk, &asoc->asconf_send_queue, sctp_next) { in sctp_audit_retranmission_queue()
75 if (chk->sent == SCTP_DATAGRAM_RESEND) { in sctp_audit_retranmission_queue()
76 sctp_ucount_incr(asoc->sent_queue_retran_cnt); in sctp_audit_retranmission_queue()
80 asoc->sent_queue_retran_cnt, in sctp_audit_retranmission_queue()
81 asoc->sent_queue_cnt); in sctp_audit_retranmission_queue()
92 net->error_count++; in sctp_threshold_management()
94 (void *)net, net->error_count, in sctp_threshold_management()
95 net->failure_threshold); in sctp_threshold_management()
96 if (net->error_count > net->failure_threshold) { in sctp_threshold_management()
98 if (net->dest_state & SCTP_ADDR_REACHABLE) { in sctp_threshold_management()
99 net->dest_state &= ~SCTP_ADDR_REACHABLE; in sctp_threshold_management()
100 net->dest_state &= ~SCTP_ADDR_REQ_PRIMARY; in sctp_threshold_management()
101 net->dest_state &= ~SCTP_ADDR_PF; in sctp_threshold_management()
106 } else if ((net->pf_threshold < net->failure_threshold) && in sctp_threshold_management()
107 (net->error_count > net->pf_threshold)) { in sctp_threshold_management()
108 if ((net->dest_state & SCTP_ADDR_PF) == 0) { in sctp_threshold_management()
109 net->dest_state |= SCTP_ADDR_PF; in sctp_threshold_management()
110 net->last_active = sctp_get_tick_count(); in sctp_threshold_management()
118 if ((net->dest_state & SCTP_ADDR_UNCONFIRMED) == 0) { in sctp_threshold_management()
121 stcb->asoc.overall_error_count, in sctp_threshold_management()
122 (stcb->asoc.overall_error_count + 1), in sctp_threshold_management()
126 stcb->asoc.overall_error_count++; in sctp_threshold_management()
131 stcb->asoc.overall_error_count, in sctp_threshold_management()
132 (stcb->asoc.overall_error_count + 1), in sctp_threshold_management()
136 stcb->asoc.overall_error_count++; in sctp_threshold_management()
139 (void *)&stcb->asoc, stcb->asoc.overall_error_count, in sctp_threshold_management()
141 ((net == NULL) ? (uint32_t)0 : (uint32_t)net->dest_state)); in sctp_threshold_management()
146 if (stcb->asoc.overall_error_count > threshold) { in sctp_threshold_management()
152 inp->last_abort_code = SCTP_FROM_SCTP_TIMER + SCTP_LOC_2; in sctp_threshold_management()
160 * sctp_find_alternate_net() returns a non-NULL pointer as long as there
169 struct sctp_nets *alt, *mnet, *min_errors_net = NULL, *max_cwnd_net = NULL; in sctp_find_alternate_net() local
172 /* JRS 5/14/07 - Initialize min_errors to an impossible value. */ in sctp_find_alternate_net()
173 int min_errors = -1; in sctp_find_alternate_net()
176 if (stcb->asoc.numnets == 1) { in sctp_find_alternate_net()
178 return (TAILQ_FIRST(&stcb->asoc.nets)); in sctp_find_alternate_net()
181 * JRS 5/14/07 - If mode is set to 2, use the CMT PF find alternate in sctp_find_alternate_net()
189 TAILQ_FOREACH(mnet, &stcb->asoc.nets, sctp_next) { in sctp_find_alternate_net()
191 * JRS 5/14/07 - If the destination is unreachable in sctp_find_alternate_net()
194 if (((mnet->dest_state & SCTP_ADDR_REACHABLE) != SCTP_ADDR_REACHABLE) || in sctp_find_alternate_net()
195 (mnet->dest_state & SCTP_ADDR_UNCONFIRMED)) { in sctp_find_alternate_net()
199 * JRS 5/14/07 - If the destination is reachable in sctp_find_alternate_net()
206 if (mnet->dest_state & SCTP_ADDR_PF) { in sctp_find_alternate_net()
208 * JRS 5/14/07 - If the destination under in sctp_find_alternate_net()
216 if (min_errors == -1) { in sctp_find_alternate_net()
217 min_errors = mnet->error_count + 1; in sctp_find_alternate_net()
219 } else if (mnet->error_count + 1 < min_errors) { in sctp_find_alternate_net()
220 min_errors = mnet->error_count + 1; in sctp_find_alternate_net()
222 } else if (mnet->error_count + 1 == min_errors in sctp_find_alternate_net()
223 && mnet->last_active > min_errors_net->last_active) { in sctp_find_alternate_net()
225 min_errors = mnet->error_count + 1; in sctp_find_alternate_net()
229 if (min_errors == -1) { in sctp_find_alternate_net()
230 min_errors = mnet->error_count; in sctp_find_alternate_net()
232 } else if (mnet->error_count < min_errors) { in sctp_find_alternate_net()
233 min_errors = mnet->error_count; in sctp_find_alternate_net()
235 } else if (mnet->error_count == min_errors in sctp_find_alternate_net()
236 && mnet->last_active > min_errors_net->last_active) { in sctp_find_alternate_net()
238 min_errors = mnet->error_count; in sctp_find_alternate_net()
244 * JRS 5/14/07 - If the destination is reachable and in sctp_find_alternate_net()
251 if (max_cwnd < mnet->cwnd) { in sctp_find_alternate_net()
253 max_cwnd = mnet->cwnd; in sctp_find_alternate_net()
254 } else if (max_cwnd == mnet->cwnd) { in sctp_find_alternate_net()
258 if (stcb->asoc.hb_random_idx > 3) { in sctp_find_alternate_net()
259 rndval = sctp_select_initial_TSN(&stcb->sctp_ep->sctp_ep); in sctp_find_alternate_net()
260 memcpy(stcb->asoc.hb_random_values, &rndval, sizeof(stcb->asoc.hb_random_values)); in sctp_find_alternate_net()
261 this_random = stcb->asoc.hb_random_values[0]; in sctp_find_alternate_net()
262 stcb->asoc.hb_random_idx++; in sctp_find_alternate_net()
263 stcb->asoc.hb_ect_randombit = 0; in sctp_find_alternate_net()
265 this_random = stcb->asoc.hb_random_values[stcb->asoc.hb_random_idx]; in sctp_find_alternate_net()
266 stcb->asoc.hb_random_idx++; in sctp_find_alternate_net()
267 stcb->asoc.hb_ect_randombit = 0; in sctp_find_alternate_net()
271 max_cwnd = mnet->cwnd; /* Useless? */ in sctp_find_alternate_net()
283 } /* JRS 5/14/07 - If mode is set to 1, use the in sctp_find_alternate_net()
286 TAILQ_FOREACH(mnet, &stcb->asoc.nets, sctp_next) { in sctp_find_alternate_net()
287 if (((mnet->dest_state & SCTP_ADDR_REACHABLE) != SCTP_ADDR_REACHABLE) || in sctp_find_alternate_net()
288 (mnet->dest_state & SCTP_ADDR_UNCONFIRMED)) { in sctp_find_alternate_net()
290 * will skip ones that are not-reachable or in sctp_find_alternate_net()
295 if (max_cwnd < mnet->cwnd) { in sctp_find_alternate_net()
297 max_cwnd = mnet->cwnd; in sctp_find_alternate_net()
298 } else if (max_cwnd == mnet->cwnd) { in sctp_find_alternate_net()
302 if (stcb->asoc.hb_random_idx > 3) { in sctp_find_alternate_net()
303 rndval = sctp_select_initial_TSN(&stcb->sctp_ep->sctp_ep); in sctp_find_alternate_net()
304 memcpy(stcb->asoc.hb_random_values, &rndval, in sctp_find_alternate_net()
305 sizeof(stcb->asoc.hb_random_values)); in sctp_find_alternate_net()
306 this_random = stcb->asoc.hb_random_values[0]; in sctp_find_alternate_net()
307 stcb->asoc.hb_random_idx = 0; in sctp_find_alternate_net()
308 stcb->asoc.hb_ect_randombit = 0; in sctp_find_alternate_net()
310 this_random = stcb->asoc.hb_random_values[stcb->asoc.hb_random_idx]; in sctp_find_alternate_net()
311 stcb->asoc.hb_random_idx++; in sctp_find_alternate_net()
312 stcb->asoc.hb_ect_randombit = 0; in sctp_find_alternate_net()
316 max_cwnd = mnet->cwnd; in sctp_find_alternate_net()
325 if ((net != NULL) && ((net->dest_state & SCTP_ADDR_BEING_DELETED) == 0)) { in sctp_find_alternate_net()
326 alt = TAILQ_NEXT(net, sctp_next); in sctp_find_alternate_net()
328 alt = TAILQ_FIRST(&stcb->asoc.nets); in sctp_find_alternate_net()
332 if (alt == NULL) { in sctp_find_alternate_net()
334 alt = TAILQ_FIRST(&stcb->asoc.nets); in sctp_find_alternate_net()
338 if (alt == NULL) { in sctp_find_alternate_net()
342 if (alt->ro.ro_nh == NULL) { in sctp_find_alternate_net()
343 if (alt->ro._s_addr) { in sctp_find_alternate_net()
344 sctp_free_ifa(alt->ro._s_addr); in sctp_find_alternate_net()
345 alt->ro._s_addr = NULL; in sctp_find_alternate_net()
347 alt->src_addr_selected = 0; in sctp_find_alternate_net()
349 if (((alt->dest_state & SCTP_ADDR_REACHABLE) == SCTP_ADDR_REACHABLE) && in sctp_find_alternate_net()
350 (alt->ro.ro_nh != NULL) && in sctp_find_alternate_net()
351 ((alt->dest_state & SCTP_ADDR_UNCONFIRMED) == 0) && in sctp_find_alternate_net()
352 (alt != net)) { in sctp_find_alternate_net()
356 alt = TAILQ_NEXT(alt, sctp_next); in sctp_find_alternate_net()
359 if (alt == NULL) { in sctp_find_alternate_net()
364 if ((net != NULL) && ((net->dest_state & SCTP_ADDR_BEING_DELETED) == 0)) { in sctp_find_alternate_net()
365 alt = TAILQ_NEXT(net, sctp_next); in sctp_find_alternate_net()
367 alt = TAILQ_FIRST(&stcb->asoc.nets); in sctp_find_alternate_net()
371 if (alt == NULL) { in sctp_find_alternate_net()
373 alt = TAILQ_FIRST(&stcb->asoc.nets); in sctp_find_alternate_net()
377 if (alt == NULL) { in sctp_find_alternate_net()
381 if (((alt->dest_state & SCTP_ADDR_UNCONFIRMED) == 0) && in sctp_find_alternate_net()
382 (alt != net)) { in sctp_find_alternate_net()
389 alt = TAILQ_NEXT(alt, sctp_next); in sctp_find_alternate_net()
392 if (alt == NULL) { in sctp_find_alternate_net()
398 if ((net != NULL) && ((net->dest_state & SCTP_ADDR_BEING_DELETED) == 0)) { in sctp_find_alternate_net()
399 alt = net; in sctp_find_alternate_net()
401 if (alt == NULL) { in sctp_find_alternate_net()
402 alt = TAILQ_FIRST(&stcb->asoc.nets); in sctp_find_alternate_net()
405 return (alt); in sctp_find_alternate_net()
414 if (net->RTO == 0) { in sctp_backoff_on_timeout()
415 if (net->RTO_measured) { in sctp_backoff_on_timeout()
416 net->RTO = stcb->asoc.minrto; in sctp_backoff_on_timeout()
418 net->RTO = stcb->asoc.initial_rto; in sctp_backoff_on_timeout()
421 net->RTO <<= 1; in sctp_backoff_on_timeout()
422 if (net->RTO > stcb->asoc.maxrto) { in sctp_backoff_on_timeout()
423 net->RTO = stcb->asoc.maxrto; in sctp_backoff_on_timeout()
427 /* JRS - Use the congestion control given in the CC module */ in sctp_backoff_on_timeout()
428 stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout(stcb, net); in sctp_backoff_on_timeout()
439 asoc = &stcb->asoc; in sctp_recover_sent_list()
440 TAILQ_FOREACH_SAFE(chk, &asoc->sent_queue, sctp_next, nchk) { in sctp_recover_sent_list()
441 if (SCTP_TSN_GE(asoc->last_acked_seq, chk->rec.data.tsn)) { in sctp_recover_sent_list()
443 (void *)chk, chk->rec.data.tsn, asoc->last_acked_seq); in sctp_recover_sent_list()
444 if (chk->sent != SCTP_DATAGRAM_NR_ACKED) { in sctp_recover_sent_list()
445 if (asoc->strmout[chk->rec.data.sid].chunks_on_queues > 0) { in sctp_recover_sent_list()
446 asoc->strmout[chk->rec.data.sid].chunks_on_queues--; in sctp_recover_sent_list()
449 if ((asoc->strmout[chk->rec.data.sid].chunks_on_queues == 0) && in sctp_recover_sent_list()
450 (asoc->strmout[chk->rec.data.sid].state == SCTP_STREAM_RESET_PENDING) && in sctp_recover_sent_list()
451 TAILQ_EMPTY(&asoc->strmout[chk->rec.data.sid].outqueue)) { in sctp_recover_sent_list()
452 asoc->trigger_reset = 1; in sctp_recover_sent_list()
454 TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next); in sctp_recover_sent_list()
455 if (PR_SCTP_ENABLED(chk->flags)) { in sctp_recover_sent_list()
456 if (asoc->pr_sctp_cnt != 0) in sctp_recover_sent_list()
457 asoc->pr_sctp_cnt--; in sctp_recover_sent_list()
459 if (chk->data) { in sctp_recover_sent_list()
462 sctp_m_freem(chk->data); in sctp_recover_sent_list()
463 chk->data = NULL; in sctp_recover_sent_list()
464 if (asoc->prsctp_supported && PR_SCTP_BUF_ENABLED(chk->flags)) { in sctp_recover_sent_list()
465 asoc->sent_queue_cnt_removeable--; in sctp_recover_sent_list()
468 asoc->sent_queue_cnt--; in sctp_recover_sent_list()
473 TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) { in sctp_recover_sent_list()
474 SCTP_PRINTF("chk:%p TSN:%x\n", (void *)chk, chk->rec.data.tsn); in sctp_recover_sent_list()
482 struct sctp_nets *alt, in sctp_mark_all_for_resend() argument
490 * retransmission. Move them to alt for there destination as well... in sctp_mark_all_for_resend()
492 * have received feed-back. in sctp_mark_all_for_resend()
515 /* get cur rto in micro-seconds */ in sctp_mark_all_for_resend()
516 cur_rto = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; in sctp_mark_all_for_resend()
520 stcb->asoc.peers_rwnd, in sctp_mark_all_for_resend()
523 sctp_log_fr(net->flight_size, 0, 0, SCTP_FR_CWND_REPORT); in sctp_mark_all_for_resend()
524 sctp_log_fr(net->flight_size, net->cwnd, stcb->asoc.total_flight, SCTP_FR_CWND_REPORT); in sctp_mark_all_for_resend()
547 orig_flight = net->flight_size; in sctp_mark_all_for_resend()
548 orig_tf = stcb->asoc.total_flight; in sctp_mark_all_for_resend()
550 net->fast_retran_ip = 0; in sctp_mark_all_for_resend()
558 TAILQ_FOREACH_SAFE(chk, &stcb->asoc.sent_queue, sctp_next, nchk) { in sctp_mark_all_for_resend()
559 if (SCTP_TSN_GE(stcb->asoc.last_acked_seq, chk->rec.data.tsn)) { in sctp_mark_all_for_resend()
562 (unsigned int)stcb->asoc.last_acked_seq, (unsigned int)chk->rec.data.tsn); in sctp_mark_all_for_resend()
564 panic("last acked >= chk on sent-Q"); in sctp_mark_all_for_resend()
576 if ((chk->whoTo == net) && (chk->sent < SCTP_DATAGRAM_ACKED)) { in sctp_mark_all_for_resend()
587 sctp_log_fr(chk->rec.data.tsn, in sctp_mark_all_for_resend()
588 (uint32_t)chk->sent_rcv_time.tv_sec, in sctp_mark_all_for_resend()
589 chk->sent_rcv_time.tv_usec, in sctp_mark_all_for_resend()
592 if ((chk->sent_rcv_time.tv_sec > min_wait.tv_sec) && (window_probe == 0)) { in sctp_mark_all_for_resend()
600 (uint32_t)chk->sent_rcv_time.tv_sec, in sctp_mark_all_for_resend()
601 chk->sent_rcv_time.tv_usec, in sctp_mark_all_for_resend()
605 } else if ((chk->sent_rcv_time.tv_sec == min_wait.tv_sec) && in sctp_mark_all_for_resend()
611 if (chk->sent_rcv_time.tv_usec >= min_wait.tv_usec) { in sctp_mark_all_for_resend()
619 if (stcb->asoc.prsctp_supported && PR_SCTP_TTL_ENABLED(chk->flags)) { in sctp_mark_all_for_resend()
621 if (timevalcmp(&now, &chk->rec.data.timetodrop, >)) { in sctp_mark_all_for_resend()
623 if (chk->data) { in sctp_mark_all_for_resend()
633 if (stcb->asoc.prsctp_supported && PR_SCTP_RTX_ENABLED(chk->flags)) { in sctp_mark_all_for_resend()
635 if (chk->snd_count > chk->rec.data.timetodrop.tv_sec) { in sctp_mark_all_for_resend()
636 if (chk->data) { in sctp_mark_all_for_resend()
646 if (chk->sent < SCTP_DATAGRAM_RESEND) { in sctp_mark_all_for_resend()
647 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); in sctp_mark_all_for_resend()
651 tsnfirst = chk->rec.data.tsn; in sctp_mark_all_for_resend()
653 tsnlast = chk->rec.data.tsn; in sctp_mark_all_for_resend()
655 sctp_log_fr(chk->rec.data.tsn, chk->snd_count, in sctp_mark_all_for_resend()
659 if (chk->rec.data.chunk_was_revoked) { in sctp_mark_all_for_resend()
661 chk->whoTo->cwnd -= chk->book_size; in sctp_mark_all_for_resend()
662 chk->rec.data.chunk_was_revoked = 0; in sctp_mark_all_for_resend()
664 net->marked_retrans++; in sctp_mark_all_for_resend()
665 stcb->asoc.marked_retrans++; in sctp_mark_all_for_resend()
668 chk->whoTo->flight_size, in sctp_mark_all_for_resend()
669 chk->book_size, in sctp_mark_all_for_resend()
670 (uint32_t)(uintptr_t)chk->whoTo, in sctp_mark_all_for_resend()
671 chk->rec.data.tsn); in sctp_mark_all_for_resend()
675 stcb->asoc.peers_rwnd += chk->send_size; in sctp_mark_all_for_resend()
676 stcb->asoc.peers_rwnd += SCTP_BASE_SYSCTL(sctp_peer_chunk_oh); in sctp_mark_all_for_resend()
678 chk->sent = SCTP_DATAGRAM_RESEND; in sctp_mark_all_for_resend()
679 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; in sctp_mark_all_for_resend()
683 chk->rec.data.doing_fast_retransmit = 0; in sctp_mark_all_for_resend()
686 if (chk->do_rtt) { in sctp_mark_all_for_resend()
687 if (chk->whoTo->rto_needed == 0) { in sctp_mark_all_for_resend()
688 chk->whoTo->rto_needed = 1; in sctp_mark_all_for_resend()
691 chk->do_rtt = 0; in sctp_mark_all_for_resend()
692 if (alt != net) { in sctp_mark_all_for_resend()
693 sctp_free_remote_addr(chk->whoTo); in sctp_mark_all_for_resend()
694 chk->no_fr_allowed = 1; in sctp_mark_all_for_resend()
695 chk->whoTo = alt; in sctp_mark_all_for_resend()
696 atomic_add_int(&alt->ref_count, 1); in sctp_mark_all_for_resend()
698 chk->no_fr_allowed = 0; in sctp_mark_all_for_resend()
699 if (TAILQ_EMPTY(&stcb->asoc.send_queue)) { in sctp_mark_all_for_resend()
700 chk->rec.data.fast_retran_tsn = stcb->asoc.sending_seq; in sctp_mark_all_for_resend()
702 chk->rec.data.fast_retran_tsn = (TAILQ_FIRST(&stcb->asoc.send_queue))->rec.data.tsn; in sctp_mark_all_for_resend()
708 if (stcb->asoc.sctp_cmt_on_off > 0) { in sctp_mark_all_for_resend()
709 chk->no_fr_allowed = 1; in sctp_mark_all_for_resend()
712 } else if (chk->sent == SCTP_DATAGRAM_ACKED) { in sctp_mark_all_for_resend()
717 if (chk->sent == SCTP_DATAGRAM_RESEND) { in sctp_mark_all_for_resend()
721 if ((orig_flight - net->flight_size) != (orig_tf - stcb->asoc.total_flight)) { in sctp_mark_all_for_resend()
733 SCTPDBG(SCTP_DEBUG_TIMER1, "Num marked for retransmission was %d peer-rwd:%u\n", in sctp_mark_all_for_resend()
735 stcb->asoc.peers_rwnd); in sctp_mark_all_for_resend()
744 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { in sctp_mark_all_for_resend()
745 if (chk->sent == SCTP_DATAGRAM_RESEND) { in sctp_mark_all_for_resend()
748 if ((chk->whoTo == net) && in sctp_mark_all_for_resend()
749 (chk->rec.chunk_id.id == SCTP_ECN_ECHO)) { in sctp_mark_all_for_resend()
750 sctp_free_remote_addr(chk->whoTo); in sctp_mark_all_for_resend()
751 chk->whoTo = alt; in sctp_mark_all_for_resend()
752 if (chk->sent != SCTP_DATAGRAM_RESEND) { in sctp_mark_all_for_resend()
753 chk->sent = SCTP_DATAGRAM_RESEND; in sctp_mark_all_for_resend()
754 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; in sctp_mark_all_for_resend()
755 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); in sctp_mark_all_for_resend()
758 atomic_add_int(&alt->ref_count, 1); in sctp_mark_all_for_resend()
762 if ((stcb->asoc.sent_queue_retran_cnt == 0) && (could_be_sent)) { in sctp_mark_all_for_resend()
764 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); in sctp_mark_all_for_resend()
766 could_be_sent->sent = SCTP_DATAGRAM_RESEND; in sctp_mark_all_for_resend()
769 if (stcb->asoc.sent_queue_retran_cnt != cnt_mk) { in sctp_mark_all_for_resend()
772 cnt_mk, stcb->asoc.sent_queue_retran_cnt, num_mk); in sctp_mark_all_for_resend()
775 stcb->asoc.sent_queue_retran_cnt = cnt_mk; in sctp_mark_all_for_resend()
782 stcb->asoc.total_flight = 0; in sctp_mark_all_for_resend()
783 stcb->asoc.total_flight_count = 0; in sctp_mark_all_for_resend()
785 TAILQ_FOREACH(lnets, &stcb->asoc.nets, sctp_next) { in sctp_mark_all_for_resend()
786 lnets->flight_size = 0; in sctp_mark_all_for_resend()
788 "Net:%p c-f cwnd:%d ssthresh:%d\n", in sctp_mark_all_for_resend()
789 (void *)lnets, lnets->cwnd, lnets->ssthresh); in sctp_mark_all_for_resend()
791 TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) { in sctp_mark_all_for_resend()
792 if (chk->sent < SCTP_DATAGRAM_RESEND) { in sctp_mark_all_for_resend()
795 chk->whoTo->flight_size, in sctp_mark_all_for_resend()
796 chk->book_size, in sctp_mark_all_for_resend()
797 (uint32_t)(uintptr_t)chk->whoTo, in sctp_mark_all_for_resend()
798 chk->rec.data.tsn); in sctp_mark_all_for_resend()
815 struct sctp_nets *alt; in sctp_t3rxt_timer() local
824 TAILQ_FOREACH(lnet, &stcb->asoc.nets, sctp_next) { in sctp_t3rxt_timer()
833 if ((stcb->asoc.peers_rwnd == 0) && in sctp_t3rxt_timer()
834 (stcb->asoc.total_flight < net->mtu)) { in sctp_t3rxt_timer()
844 stcb->asoc.max_send_times)) { in sctp_t3rxt_timer()
848 if (net != stcb->asoc.primary_destination) { in sctp_t3rxt_timer()
854 if (net->last_sent_time.tv_sec) { in sctp_t3rxt_timer()
855 ms_goneby = (uint32_t)(now.tv_sec - net->last_sent_time.tv_sec) * 1000; in sctp_t3rxt_timer()
859 if ((net->dest_state & SCTP_ADDR_PF) == 0) { in sctp_t3rxt_timer()
860 if ((ms_goneby > net->RTO) || (net->RTO == 0)) { in sctp_t3rxt_timer()
879 stcb->asoc.max_send_times)) { in sctp_t3rxt_timer()
884 if (stcb->asoc.sctp_cmt_on_off > 0) { in sctp_t3rxt_timer()
885 if (net->pf_threshold < net->failure_threshold) { in sctp_t3rxt_timer()
886 alt = sctp_find_alternate_net(stcb, net, 2); in sctp_t3rxt_timer()
893 alt = sctp_find_alternate_net(stcb, net, 1); in sctp_t3rxt_timer()
896 * retransmission, then new (rtx-)pseudo_cumack in sctp_t3rxt_timer()
898 * track new (rtx-) pseudo-cumack always. in sctp_t3rxt_timer()
900 net->find_pseudo_cumack = 1; in sctp_t3rxt_timer()
901 net->find_rtx_pseudo_cumack = 1; in sctp_t3rxt_timer()
904 alt = sctp_find_alternate_net(stcb, net, 0); in sctp_t3rxt_timer()
909 (void)sctp_mark_all_for_resend(stcb, net, alt, win_probe, in sctp_t3rxt_timer()
912 stcb->asoc.fast_retran_loss_recovery = 0; in sctp_t3rxt_timer()
915 net->fast_retran_loss_recovery = 0; in sctp_t3rxt_timer()
916 if ((stcb->asoc.cc_functions.sctp_cwnd_new_transmission_begins) && in sctp_t3rxt_timer()
917 (net->flight_size == 0)) { in sctp_t3rxt_timer()
918 (*stcb->asoc.cc_functions.sctp_cwnd_new_transmission_begins) (stcb, net); in sctp_t3rxt_timer()
924 stcb->asoc.sat_t3_loss_recovery = 1; in sctp_t3rxt_timer()
925 stcb->asoc.sat_t3_recovery_tsn = stcb->asoc.sending_seq; in sctp_t3rxt_timer()
929 if (((net->dest_state & SCTP_ADDR_REACHABLE) == 0) || in sctp_t3rxt_timer()
930 (net->dest_state & SCTP_ADDR_PF)) { in sctp_t3rxt_timer()
938 if (net->ro._s_addr != NULL) { in sctp_t3rxt_timer()
939 sctp_free_ifa(net->ro._s_addr); in sctp_t3rxt_timer()
940 net->ro._s_addr = NULL; in sctp_t3rxt_timer()
942 net->src_addr_selected = 0; in sctp_t3rxt_timer()
945 RO_NHFREE(&net->ro); in sctp_t3rxt_timer()
948 if ((stcb->asoc.primary_destination == net) && (alt != net)) { in sctp_t3rxt_timer()
953 * change-primary then this flag must be cleared in sctp_t3rxt_timer()
956 if (stcb->asoc.alternate != NULL) { in sctp_t3rxt_timer()
957 sctp_free_remote_addr(stcb->asoc.alternate); in sctp_t3rxt_timer()
959 stcb->asoc.alternate = alt; in sctp_t3rxt_timer()
960 atomic_add_int(&stcb->asoc.alternate->ref_count, 1); in sctp_t3rxt_timer()
964 * Special case for cookie-echo'ed case, we don't do output but must in sctp_t3rxt_timer()
965 * await the COOKIE-ACK before retransmission in sctp_t3rxt_timer()
975 if (stcb->asoc.prsctp_supported) { in sctp_t3rxt_timer()
978 lchk = sctp_try_advance_peer_ack_point(stcb, &stcb->asoc); in sctp_t3rxt_timer()
979 /* C3. See if we need to send a Fwd-TSN */ in sctp_t3rxt_timer()
980 if (SCTP_TSN_GT(stcb->asoc.advanced_peer_ack_point, stcb->asoc.last_acked_seq)) { in sctp_t3rxt_timer()
981 send_forward_tsn(stcb, &stcb->asoc); in sctp_t3rxt_timer()
983 if (lchk->whoTo != NULL) { in sctp_t3rxt_timer()
989 sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, lchk->whoTo); in sctp_t3rxt_timer()
994 sctp_log_cwnd(stcb, net, net->cwnd, SCTP_CWND_LOG_FROM_RTX); in sctp_t3rxt_timer()
1005 if (stcb->asoc.delayed_connection) { in sctp_t1init_timer()
1010 stcb->asoc.delayed_connection = 0; in sctp_t1init_timer()
1018 stcb->asoc.max_init_times)) { in sctp_t1init_timer()
1022 stcb->asoc.dropped_special_cnt = 0; in sctp_t1init_timer()
1023 sctp_backoff_on_timeout(stcb, stcb->asoc.primary_destination, 1, 0, 0); in sctp_t1init_timer()
1024 if (stcb->asoc.initial_init_rto_max < net->RTO) { in sctp_t1init_timer()
1025 net->RTO = stcb->asoc.initial_init_rto_max; in sctp_t1init_timer()
1027 if (stcb->asoc.numnets > 1) { in sctp_t1init_timer()
1029 struct sctp_nets *alt; in sctp_t1init_timer() local
1031 alt = sctp_find_alternate_net(stcb, stcb->asoc.primary_destination, 0); in sctp_t1init_timer()
1032 if (alt != stcb->asoc.primary_destination) { in sctp_t1init_timer()
1033 sctp_move_chunks_from_net(stcb, stcb->asoc.primary_destination); in sctp_t1init_timer()
1034 stcb->asoc.primary_destination = alt; in sctp_t1init_timer()
1052 struct sctp_nets *alt; in sctp_cookie_timer() local
1056 TAILQ_FOREACH(cookie, &stcb->asoc.control_send_queue, sctp_next) { in sctp_cookie_timer()
1057 if (cookie->rec.chunk_id.id == SCTP_COOKIE_ECHO) { in sctp_cookie_timer()
1068 inp->last_abort_code = SCTP_FROM_SCTP_TIMER + SCTP_LOC_3; in sctp_cookie_timer()
1074 …SCTP_PRINTF("Strange in state %d not cookie-echoed yet c-e timer expires?\n", SCTP_GET_STATE(stcb)… in sctp_cookie_timer()
1081 if (sctp_threshold_management(inp, stcb, cookie->whoTo, in sctp_cookie_timer()
1082 stcb->asoc.max_init_times)) { in sctp_cookie_timer()
1090 stcb->asoc.dropped_special_cnt = 0; in sctp_cookie_timer()
1091 sctp_backoff_on_timeout(stcb, cookie->whoTo, 1, 0, 0); in sctp_cookie_timer()
1092 alt = sctp_find_alternate_net(stcb, cookie->whoTo, 0); in sctp_cookie_timer()
1093 if (alt != cookie->whoTo) { in sctp_cookie_timer()
1094 sctp_free_remote_addr(cookie->whoTo); in sctp_cookie_timer()
1095 cookie->whoTo = alt; in sctp_cookie_timer()
1096 atomic_add_int(&alt->ref_count, 1); in sctp_cookie_timer()
1099 if (cookie->sent != SCTP_DATAGRAM_RESEND) { in sctp_cookie_timer()
1100 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); in sctp_cookie_timer()
1102 cookie->sent = SCTP_DATAGRAM_RESEND; in sctp_cookie_timer()
1103 cookie->flags |= CHUNK_FLAGS_FRAGMENT_OK; in sctp_cookie_timer()
1115 struct sctp_nets *alt, *net; in sctp_strreset_timer() local
1118 if (stcb->asoc.stream_reset_outstanding == 0) { in sctp_strreset_timer()
1122 (void)sctp_find_stream_reset(stcb, stcb->asoc.str_reset_seq_out, &strrst); in sctp_strreset_timer()
1126 net = strrst->whoTo; in sctp_strreset_timer()
1128 if (sctp_threshold_management(inp, stcb, net, stcb->asoc.max_send_times)) { in sctp_strreset_timer()
1137 alt = sctp_find_alternate_net(stcb, net, 0); in sctp_strreset_timer()
1138 strrst->whoTo = alt; in sctp_strreset_timer()
1139 atomic_add_int(&alt->ref_count, 1); in sctp_strreset_timer()
1142 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { in sctp_strreset_timer()
1143 if ((chk->whoTo == net) && in sctp_strreset_timer()
1144 (chk->rec.chunk_id.id == SCTP_ECN_ECHO)) { in sctp_strreset_timer()
1145 sctp_free_remote_addr(chk->whoTo); in sctp_strreset_timer()
1146 if (chk->sent != SCTP_DATAGRAM_RESEND) { in sctp_strreset_timer()
1147 chk->sent = SCTP_DATAGRAM_RESEND; in sctp_strreset_timer()
1148 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; in sctp_strreset_timer()
1149 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); in sctp_strreset_timer()
1151 chk->whoTo = alt; in sctp_strreset_timer()
1152 atomic_add_int(&alt->ref_count, 1); in sctp_strreset_timer()
1155 if ((net->dest_state & SCTP_ADDR_REACHABLE) == 0) { in sctp_strreset_timer()
1157 * If the address went un-reachable, we need to move to in sctp_strreset_timer()
1165 if (strrst->sent != SCTP_DATAGRAM_RESEND) in sctp_strreset_timer()
1166 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); in sctp_strreset_timer()
1167 strrst->sent = SCTP_DATAGRAM_RESEND; in sctp_strreset_timer()
1168 strrst->flags |= CHUNK_FLAGS_FRAGMENT_OK; in sctp_strreset_timer()
1171 sctp_timer_start(SCTP_TIMER_TYPE_STRRESET, inp, stcb, alt); in sctp_strreset_timer()
1179 struct sctp_nets *alt; in sctp_asconf_timer() local
1183 if (TAILQ_EMPTY(&stcb->asoc.asconf_send_queue)) { in sctp_asconf_timer()
1192 asconf = TAILQ_FIRST(&stcb->asoc.asconf_send_queue); in sctp_asconf_timer()
1196 net = asconf->whoTo; in sctp_asconf_timer()
1199 stcb->asoc.max_send_times)) { in sctp_asconf_timer()
1203 if (asconf->snd_count > stcb->asoc.max_send_times) { in sctp_asconf_timer()
1220 alt = sctp_find_alternate_net(stcb, net, 0); in sctp_asconf_timer()
1221 if (asconf->whoTo != alt) { in sctp_asconf_timer()
1222 asconf->whoTo = alt; in sctp_asconf_timer()
1223 atomic_add_int(&alt->ref_count, 1); in sctp_asconf_timer()
1227 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { in sctp_asconf_timer()
1228 if ((chk->whoTo == net) && in sctp_asconf_timer()
1229 (chk->rec.chunk_id.id == SCTP_ECN_ECHO)) { in sctp_asconf_timer()
1230 sctp_free_remote_addr(chk->whoTo); in sctp_asconf_timer()
1231 chk->whoTo = alt; in sctp_asconf_timer()
1232 if (chk->sent != SCTP_DATAGRAM_RESEND) { in sctp_asconf_timer()
1233 chk->sent = SCTP_DATAGRAM_RESEND; in sctp_asconf_timer()
1234 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; in sctp_asconf_timer()
1235 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); in sctp_asconf_timer()
1237 atomic_add_int(&alt->ref_count, 1); in sctp_asconf_timer()
1240 TAILQ_FOREACH(chk, &stcb->asoc.asconf_send_queue, sctp_next) { in sctp_asconf_timer()
1241 if (chk->whoTo != alt) { in sctp_asconf_timer()
1242 sctp_free_remote_addr(chk->whoTo); in sctp_asconf_timer()
1243 chk->whoTo = alt; in sctp_asconf_timer()
1244 atomic_add_int(&alt->ref_count, 1); in sctp_asconf_timer()
1246 if (asconf->sent != SCTP_DATAGRAM_RESEND && chk->sent != SCTP_DATAGRAM_UNSENT) in sctp_asconf_timer()
1247 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); in sctp_asconf_timer()
1248 chk->sent = SCTP_DATAGRAM_RESEND; in sctp_asconf_timer()
1249 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; in sctp_asconf_timer()
1251 if ((net->dest_state & SCTP_ADDR_REACHABLE) == 0) { in sctp_asconf_timer()
1253 * If the address went un-reachable, we need to move in sctp_asconf_timer()
1261 if (asconf->sent != SCTP_DATAGRAM_RESEND) in sctp_asconf_timer()
1262 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); in sctp_asconf_timer()
1263 asconf->sent = SCTP_DATAGRAM_RESEND; in sctp_asconf_timer()
1264 asconf->flags |= CHUNK_FLAGS_FRAGMENT_OK; in sctp_asconf_timer()
1267 sctp_send_asconf(stcb, alt, SCTP_ADDR_NOT_LOCKED); in sctp_asconf_timer()
1276 if (stcb->asoc.deleted_primary == NULL) { in sctp_delete_prim_timer()
1282 SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, &stcb->asoc.deleted_primary->ro._l_addr.sa); in sctp_delete_prim_timer()
1283 sctp_free_remote_addr(stcb->asoc.deleted_primary); in sctp_delete_prim_timer()
1284 stcb->asoc.deleted_primary = NULL; in sctp_delete_prim_timer()
1290 * For the shutdown and shutdown-ack, we do not keep one around on the
1293 * It is assumed that net is non-NULL.
1299 struct sctp_nets *alt; in sctp_shutdown_timer() local
1302 if (sctp_threshold_management(inp, stcb, net, stcb->asoc.max_send_times)) { in sctp_shutdown_timer()
1308 alt = sctp_find_alternate_net(stcb, net, 0); in sctp_shutdown_timer()
1311 sctp_send_shutdown(stcb, alt); in sctp_shutdown_timer()
1314 sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, inp, stcb, alt); in sctp_shutdown_timer()
1322 struct sctp_nets *alt; in sctp_shutdownack_timer() local
1325 if (sctp_threshold_management(inp, stcb, net, stcb->asoc.max_send_times)) { in sctp_shutdownack_timer()
1331 alt = sctp_find_alternate_net(stcb, net, 0); in sctp_shutdownack_timer()
1334 sctp_send_shutdown_ack(stcb, alt); in sctp_shutdownack_timer()
1337 sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNACK, inp, stcb, alt); in sctp_shutdownack_timer()
1351 KASSERT(TAILQ_EMPTY(&stcb->asoc.send_queue), ("send_queue not empty")); in sctp_audit_stream_queues_for_size()
1352 KASSERT(TAILQ_EMPTY(&stcb->asoc.sent_queue), ("sent_queue not empty")); in sctp_audit_stream_queues_for_size()
1354 if (stcb->asoc.sent_queue_retran_cnt) { in sctp_audit_stream_queues_for_size()
1355 SCTP_PRINTF("Hmm, sent_queue_retran_cnt is non-zero %d\n", in sctp_audit_stream_queues_for_size()
1356 stcb->asoc.sent_queue_retran_cnt); in sctp_audit_stream_queues_for_size()
1357 stcb->asoc.sent_queue_retran_cnt = 0; in sctp_audit_stream_queues_for_size()
1359 if (stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, &stcb->asoc)) { in sctp_audit_stream_queues_for_size()
1361 stcb->asoc.ss_functions.sctp_ss_init(stcb, &stcb->asoc); in sctp_audit_stream_queues_for_size()
1362 if (!stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, &stcb->asoc)) { in sctp_audit_stream_queues_for_size()
1367 stcb->asoc.total_output_queue_size = 0; in sctp_audit_stream_queues_for_size()
1371 for (i = 0; i < stcb->asoc.streamoutcnt; i++) { in sctp_audit_stream_queues_for_size()
1372 if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { in sctp_audit_stream_queues_for_size()
1373 TAILQ_FOREACH(sp, &stcb->asoc.strmout[i].outqueue, next) { in sctp_audit_stream_queues_for_size()
1374 if (sp->msg_is_complete) in sctp_audit_stream_queues_for_size()
1380 if (chks_in_queue != stcb->asoc.stream_queue_cnt) { in sctp_audit_stream_queues_for_size()
1382 stcb->asoc.stream_queue_cnt, chks_in_queue); in sctp_audit_stream_queues_for_size()
1387 if ((TAILQ_EMPTY(&stcb->asoc.send_queue)) && in sctp_audit_stream_queues_for_size()
1388 (TAILQ_EMPTY(&stcb->asoc.sent_queue))) { in sctp_audit_stream_queues_for_size()
1400 (u_long)stcb->asoc.total_output_queue_size); in sctp_audit_stream_queues_for_size()
1401 stcb->asoc.total_output_queue_size = 0; in sctp_audit_stream_queues_for_size()
1411 net_was_pf = (net->dest_state & SCTP_ADDR_PF) != 0; in sctp_heartbeat_timer()
1412 if (net->hb_responded == 0) { in sctp_heartbeat_timer()
1413 if (net->ro._s_addr != NULL) { in sctp_heartbeat_timer()
1418 sctp_free_ifa(net->ro._s_addr); in sctp_heartbeat_timer()
1419 net->ro._s_addr = NULL; in sctp_heartbeat_timer()
1420 net->src_addr_selected = 0; in sctp_heartbeat_timer()
1423 if (sctp_threshold_management(inp, stcb, net, stcb->asoc.max_send_times)) { in sctp_heartbeat_timer()
1429 if (net->partial_bytes_acked > 0) { in sctp_heartbeat_timer()
1430 net->partial_bytes_acked = 0; in sctp_heartbeat_timer()
1432 if ((stcb->asoc.total_output_queue_size > 0) && in sctp_heartbeat_timer()
1433 (TAILQ_EMPTY(&stcb->asoc.send_queue)) && in sctp_heartbeat_timer()
1434 (TAILQ_EMPTY(&stcb->asoc.sent_queue))) { in sctp_heartbeat_timer()
1437 if ((((net->dest_state & SCTP_ADDR_NOHB) == 0) || in sctp_heartbeat_timer()
1438 (net->dest_state & SCTP_ADDR_UNCONFIRMED)) && in sctp_heartbeat_timer()
1439 (net_was_pf || ((net->dest_state & SCTP_ADDR_PF) == 0))) { in sctp_heartbeat_timer()
1446 if ((net->last_sent_time.tv_sec > 0) || in sctp_heartbeat_timer()
1447 (net->last_sent_time.tv_usec > 0)) { in sctp_heartbeat_timer()
1451 timevalsub(&diff, &net->last_sent_time); in sctp_heartbeat_timer()
1457 if ((ms_gone_by >= net->heart_beat_delay) || in sctp_heartbeat_timer()
1458 (net->dest_state & SCTP_ADDR_UNCONFIRMED) || in sctp_heartbeat_timer()
1459 (net->dest_state & SCTP_ADDR_PF)) { in sctp_heartbeat_timer()
1473 next_mtu = sctp_get_next_mtu(net->mtu); in sctp_pathmtu_timer()
1475 if ((next_mtu > net->mtu) && (net->port == 0)) { in sctp_pathmtu_timer()
1476 if ((net->src_addr_selected == 0) || in sctp_pathmtu_timer()
1477 (net->ro._s_addr == NULL) || in sctp_pathmtu_timer()
1478 (net->ro._s_addr->localifa_flags & SCTP_BEING_DELETED)) { in sctp_pathmtu_timer()
1479 if ((net->ro._s_addr != NULL) && (net->ro._s_addr->localifa_flags & SCTP_BEING_DELETED)) { in sctp_pathmtu_timer()
1480 sctp_free_ifa(net->ro._s_addr); in sctp_pathmtu_timer()
1481 net->ro._s_addr = NULL; in sctp_pathmtu_timer()
1482 net->src_addr_selected = 0; in sctp_pathmtu_timer()
1483 } else if (net->ro._s_addr == NULL) { in sctp_pathmtu_timer()
1485 if (net->ro._l_addr.sa.sa_family == AF_INET6) { in sctp_pathmtu_timer()
1486 struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&net->ro._l_addr; in sctp_pathmtu_timer()
1493 net->ro._s_addr = sctp_source_address_selection(inp, in sctp_pathmtu_timer()
1495 (sctp_route_t *)&net->ro, in sctp_pathmtu_timer()
1496 net, 0, stcb->asoc.vrf_id); in sctp_pathmtu_timer()
1498 if (net->ro._l_addr.sa.sa_family == AF_INET6) { in sctp_pathmtu_timer()
1499 struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&net->ro._l_addr; in sctp_pathmtu_timer()
1505 if (net->ro._s_addr) in sctp_pathmtu_timer()
1506 net->src_addr_selected = 1; in sctp_pathmtu_timer()
1508 if (net->ro._s_addr) { in sctp_pathmtu_timer()
1509 mtu = SCTP_GATHER_MTU_FROM_ROUTE(net->ro._s_addr, &net->ro._s_addr.sa, net->ro.ro_nh); in sctp_pathmtu_timer()
1511 if (net->port) { in sctp_pathmtu_timer()
1512 mtu -= sizeof(struct udphdr); in sctp_pathmtu_timer()
1516 net->mtu = next_mtu; in sctp_pathmtu_timer()
1518 net->mtu = mtu; in sctp_pathmtu_timer()
1534 if (stcb->asoc.sctp_autoclose_ticks > 0 && in sctp_autoclose_timer()
1537 asoc = &stcb->asoc; in sctp_autoclose_timer()
1539 if (asoc->time_last_rcvd.tv_sec > in sctp_autoclose_timer()
1540 asoc->time_last_sent.tv_sec) { in sctp_autoclose_timer()
1541 tim_touse = &asoc->time_last_rcvd; in sctp_autoclose_timer()
1543 tim_touse = &asoc->time_last_sent; in sctp_autoclose_timer()
1546 ticks_gone_by = sctp_secs_to_ticks((uint32_t)(tn.tv_sec - tim_touse->tv_sec)); in sctp_autoclose_timer()
1547 if (ticks_gone_by >= asoc->sctp_autoclose_ticks) { in sctp_autoclose_timer()
1557 if (TAILQ_EMPTY(&asoc->send_queue) && in sctp_autoclose_timer()
1558 TAILQ_EMPTY(&asoc->sent_queue)) { in sctp_autoclose_timer()
1573 if (stcb->asoc.alternate) { in sctp_autoclose_timer()
1574 net = stcb->asoc.alternate; in sctp_autoclose_timer()
1576 net = stcb->asoc.primary_destination; in sctp_autoclose_timer()
1580 stcb->sctp_ep, stcb, net); in sctp_autoclose_timer()
1582 stcb->sctp_ep, stcb, NULL); in sctp_autoclose_timer()
1587 * No auto close at this time, reset t-o to check in sctp_autoclose_timer()
1593 tmp = asoc->sctp_autoclose_ticks; in sctp_autoclose_timer()
1594 asoc->sctp_autoclose_ticks -= ticks_gone_by; in sctp_autoclose_timer()
1597 asoc->sctp_autoclose_ticks = tmp; in sctp_autoclose_timer()