| 813 | } |
| 814 | |
| 815 | int |
| 816 | sctp_t3rxt_timer(struct sctp_inpcb *inp, |
| 817 | struct sctp_tcb *stcb, |
| 818 | struct sctp_nets *net) |
| 819 | { |
| 820 | struct sctp_nets *alt; |
| 821 | int win_probe, num_mk, num_abandoned; |
| 822 | |
| 823 | if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) { |
| 824 | sctp_log_fr(0, 0, 0, SCTP_FR_T3_TIMEOUT); |
| 825 | } |
| 826 | if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { |
| 827 | struct sctp_nets *lnet; |
| 828 | |
| 829 | TAILQ_FOREACH(lnet, &stcb->asoc.nets, sctp_next) { |
| 830 | if (net == lnet) { |
| 831 | sctp_log_cwnd(stcb, lnet, 1, SCTP_CWND_LOG_FROM_T3); |
| 832 | } else { |
| 833 | sctp_log_cwnd(stcb, lnet, 0, SCTP_CWND_LOG_FROM_T3); |
| 834 | } |
| 835 | } |
| 836 | } |
| 837 | /* Find an alternate and mark those for retransmission */ |
| 838 | if ((stcb->asoc.peers_rwnd == 0) && |
| 839 | (stcb->asoc.total_flight < net->mtu)) { |
| 840 | SCTP_STAT_INCR(sctps_timowindowprobe); |
| 841 | win_probe = 1; |
| 842 | } else { |
| 843 | win_probe = 0; |
| 844 | } |
| 845 | |
| 846 | if (win_probe == 0) { |
| 847 | /* We don't do normal threshold management on window probes */ |
| 848 | if (sctp_threshold_management(inp, stcb, net, |
| 849 | stcb->asoc.max_send_times)) { |
| 850 | /* Association was destroyed */ |
| 851 | return (1); |
| 852 | } else { |
| 853 | if (net != stcb->asoc.primary_destination) { |
| 854 | /* send a immediate HB if our RTO is stale */ |
| 855 | struct timeval now; |
| 856 | unsigned int ms_goneby; |
| 857 | |
| 858 | (void)SCTP_GETTIME_TIMEVAL(&now); |
| 859 | if (net->last_sent_time.tv_sec) { |
| 860 | ms_goneby = (now.tv_sec - net->last_sent_time.tv_sec) * 1000; |
| 861 | } else { |
| 862 | ms_goneby = 0; |
| 863 | } |
| 864 | if ((net->dest_state & SCTP_ADDR_PF) == 0) { |
| 865 | if ((ms_goneby > net->RTO) || (net->RTO == 0)) { |
| 866 | /* |
| 867 | * no recent feed back in an |
| 868 | * RTO or more, request a |
| 869 | * RTT update |
| 870 | */ |
| 871 | sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED); |
| 872 | } |
no test coverage detected