MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sctp_timeout_handler

Function sctp_timeout_handler

freebsd/netinet/sctputil.c:1703–2112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1701 */
1702
1703void
1704sctp_timeout_handler(void *t)
1705{
1706 struct epoch_tracker et;
1707 struct timeval tv;
1708 struct sctp_inpcb *inp;
1709 struct sctp_tcb *stcb;
1710 struct sctp_nets *net;
1711 struct sctp_timer *tmr;
1712 struct mbuf *op_err;
1713 int type;
1714 int i, secret;
1715 bool did_output, released_asoc_reference;
1716
1717 /*
1718 * If inp, stcb or net are not NULL, then references to these were
1719 * added when the timer was started, and must be released before
1720 * this function returns.
1721 */
1722 tmr = (struct sctp_timer *)t;
1723 inp = (struct sctp_inpcb *)tmr->ep;
1724 stcb = (struct sctp_tcb *)tmr->tcb;
1725 net = (struct sctp_nets *)tmr->net;
1726 CURVNET_SET((struct vnet *)tmr->vnet);
1727 NET_EPOCH_ENTER(et);
1728 released_asoc_reference = false;
1729
1730#ifdef SCTP_AUDITING_ENABLED
1731 sctp_audit_log(0xF0, (uint8_t)tmr->type);
1732 sctp_auditing(3, inp, stcb, net);
1733#endif
1734
1735 /* sanity checks... */
1736 KASSERT(tmr->self == NULL || tmr->self == tmr,
1737 ("sctp_timeout_handler: tmr->self corrupted"));
1738 KASSERT(SCTP_IS_TIMER_TYPE_VALID(tmr->type),
1739 ("sctp_timeout_handler: invalid timer type %d", tmr->type));
1740 type = tmr->type;
1741 KASSERT(stcb == NULL || stcb->sctp_ep == inp,
1742 ("sctp_timeout_handler of type %d: inp = %p, stcb->sctp_ep %p",
1743 type, stcb, stcb->sctp_ep));
1744 tmr->stopped_from = 0xa001;
1745 if ((stcb != NULL) && (stcb->asoc.state == SCTP_STATE_EMPTY)) {
1746 SCTPDBG(SCTP_DEBUG_TIMER2,
1747 "Timer type %d handler exiting due to CLOSED association.\n",
1748 type);
1749 goto out_decr;
1750 }
1751 tmr->stopped_from = 0xa002;
1752 SCTPDBG(SCTP_DEBUG_TIMER2, "Timer type %d goes off.\n", type);
1753 if (!SCTP_OS_TIMER_ACTIVE(&tmr->timer)) {
1754 SCTPDBG(SCTP_DEBUG_TIMER2,
1755 "Timer type %d handler exiting due to not being active.\n",
1756 type);
1757 goto out_decr;
1758 }
1759
1760 tmr->stopped_from = 0xa003;

Callers

nothing calls this directly

Calls 15

sctp_audit_logFunction · 0.85
sctp_auditingFunction · 0.85
sctp_t3rxt_timerFunction · 0.85
sctp_chunk_outputFunction · 0.85
sctp_timer_startFunction · 0.85
sctp_t1init_timerFunction · 0.85
sctp_send_sackFunction · 0.85
sctp_shutdown_timerFunction · 0.85
sctp_heartbeat_timerFunction · 0.85
sctp_cookie_timerFunction · 0.85
sctp_select_initial_TSNFunction · 0.85
sctp_pathmtu_timerFunction · 0.85

Tested by

no test coverage detected