| 383 | } |
| 384 | |
| 385 | static void |
| 386 | tcp_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 | |
| 420 | static void |
| 421 | tcp_reass_merge_into(struct tcpcb *tp, struct tseg_qent *ent, |
no test coverage detected