* This version of sbappend() should only be used when the caller absolutely * knows that there will never be more than one record in the socket buffer, * that is, a stream protocol (such as TCP). */
| 954 | * that is, a stream protocol (such as TCP). |
| 955 | */ |
| 956 | void |
| 957 | sbappendstream_locked(struct sockbuf *sb, struct mbuf *m, int flags) |
| 958 | { |
| 959 | SOCKBUF_LOCK_ASSERT(sb); |
| 960 | |
| 961 | KASSERT(m->m_nextpkt == NULL,("sbappendstream 0")); |
| 962 | |
| 963 | #ifdef KERN_TLS |
| 964 | /* |
| 965 | * Decrypted TLS records are appended as records via |
| 966 | * sbappendrecord(). TCP passes encrypted TLS records to this |
| 967 | * function which must be scheduled for decryption. |
| 968 | */ |
| 969 | if (sb->sb_flags & SB_TLS_RX) { |
| 970 | sbappend_ktls_rx(sb, m); |
| 971 | return; |
| 972 | } |
| 973 | #endif |
| 974 | |
| 975 | KASSERT(sb->sb_mb == sb->sb_lastrecord,("sbappendstream 1")); |
| 976 | |
| 977 | SBLASTMBUFCHK(sb); |
| 978 | |
| 979 | #ifdef KERN_TLS |
| 980 | if (sb->sb_tls_info != NULL) |
| 981 | ktls_seq(sb, m); |
| 982 | #endif |
| 983 | |
| 984 | /* Remove all packet headers and mbuf tags to get a pure data chain. */ |
| 985 | m_demote(m, 1, flags & PRUS_NOTREADY ? M_NOTREADY : 0); |
| 986 | |
| 987 | sbcompress(sb, m, sb->sb_mbtail); |
| 988 | |
| 989 | sb->sb_lastrecord = sb->sb_mb; |
| 990 | SBLASTRECORDCHK(sb); |
| 991 | } |
| 992 | |
| 993 | /* |
| 994 | * This version of sbappend() should only be used when the caller absolutely |
no test coverage detected