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

Function sctp_pathmtu_adjustment

freebsd/netinet/sctp_usrreq.c:106–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104#endif
105
106void
107sctp_pathmtu_adjustment(struct sctp_tcb *stcb, uint16_t nxtsz)
108{
109 struct sctp_tmit_chunk *chk;
110 uint16_t overhead;
111
112 /* Adjust that too */
113 stcb->asoc.smallest_mtu = nxtsz;
114 /* now off to subtract IP_DF flag if needed */
115 overhead = IP_HDR_SIZE + sizeof(struct sctphdr);
116 if (sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.peer_auth_chunks)) {
117 overhead += sctp_get_auth_chunk_len(stcb->asoc.peer_hmac_id);
118 }
119 TAILQ_FOREACH(chk, &stcb->asoc.send_queue, sctp_next) {
120 if ((chk->send_size + overhead) > nxtsz) {
121 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK;
122 }
123 }
124 TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) {
125 if ((chk->send_size + overhead) > nxtsz) {
126 /*
127 * For this guy we also mark for immediate resend
128 * since we sent to big of chunk
129 */
130 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK;
131 if (chk->sent < SCTP_DATAGRAM_RESEND) {
132 sctp_flight_size_decrease(chk);
133 sctp_total_flight_decrease(stcb, chk);
134 chk->sent = SCTP_DATAGRAM_RESEND;
135 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt);
136 chk->rec.data.doing_fast_retransmit = 0;
137 if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) {
138 sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_PMTU,
139 chk->whoTo->flight_size,
140 chk->book_size,
141 (uint32_t)(uintptr_t)chk->whoTo,
142 chk->rec.data.tsn);
143 }
144 /* Clear any time so NO RTT is being done */
145 if (chk->do_rtt == 1) {
146 chk->do_rtt = 0;
147 chk->whoTo->rto_needed = 1;
148 }
149 }
150 }
151 }
152}
153
154#ifdef INET
155void

Callers 5

sctp_notifyFunction · 0.85
sctp_setoptFunction · 0.85
sctp_add_remote_addrFunction · 0.85
sctp6_notifyFunction · 0.85

Calls 2

sctp_get_auth_chunk_lenFunction · 0.85
sctp_misc_intsFunction · 0.85

Tested by

no test coverage detected