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

Function tcp_reass_replace

freebsd/netinet/tcp_reass.c:385–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

383}
384
385static void
386tcp_reass_replace(struct tcpcb *tp, struct tseg_qent *q, struct mbuf *m,
387 tcp_seq seq, int len, struct mbuf *mlast, int mbufoh, uint8_t flags)
388{
389 /*
390 * Free the data in q, and replace
391 * it with the new segment.
392 */
393 int len_dif;
394
395#ifdef TCP_REASS_LOGGING
396 tcp_log_reassm(tp, q, NULL, seq, len, TCP_R_LOG_REPLACE, 0);
397#endif
398 m_freem(q->tqe_m);
399 KASSERT(tp->t_segqmbuflen >= q->tqe_mbuf_cnt,
400 ("Tp:%p seg queue goes negative", tp));
401 tp->t_segqmbuflen -= q->tqe_mbuf_cnt;
402 q->tqe_mbuf_cnt = mbufoh;
403 q->tqe_m = m;
404 q->tqe_last = mlast;
405 q->tqe_start = seq;
406 if (len > q->tqe_len)
407 len_dif = len - q->tqe_len;
408 else
409 len_dif = 0;
410 tp->t_rcvoopack++;
411 TCPSTAT_INC(tcps_rcvoopack);
412 TCPSTAT_ADD(tcps_rcvoobyte, len_dif);
413 q->tqe_len = len;
414 q->tqe_flags = (flags & TH_FIN);
415 q->tqe_m->m_pkthdr.len = q->tqe_len;
416 tp->t_segqmbuflen += mbufoh;
417
418}
419
420static void
421tcp_reass_merge_into(struct tcpcb *tp, struct tseg_qent *ent,

Callers 1

tcp_reassFunction · 0.85

Calls 2

tcp_log_reassmFunction · 0.85
m_freemFunction · 0.50

Tested by

no test coverage detected