* Append address and data, and optionally, control (ancillary) data to the * receive queue of a socket. If present, m0 must include a packet header * with total length. Returns 0 if no space in sockbuf or insufficient * mbufs. */
| 1193 | * mbufs. |
| 1194 | */ |
| 1195 | int |
| 1196 | sbappendaddr_locked(struct sockbuf *sb, const struct sockaddr *asa, |
| 1197 | struct mbuf *m0, struct mbuf *control) |
| 1198 | { |
| 1199 | struct mbuf *ctrl_last; |
| 1200 | int space = asa->sa_len; |
| 1201 | |
| 1202 | SOCKBUF_LOCK_ASSERT(sb); |
| 1203 | |
| 1204 | if (m0 && (m0->m_flags & M_PKTHDR) == 0) |
| 1205 | panic("sbappendaddr_locked"); |
| 1206 | if (m0) |
| 1207 | space += m0->m_pkthdr.len; |
| 1208 | space += m_length(control, &ctrl_last); |
| 1209 | |
| 1210 | if (space > sbspace(sb)) |
| 1211 | return (0); |
| 1212 | return (sbappendaddr_locked_internal(sb, asa, m0, control, ctrl_last)); |
| 1213 | } |
| 1214 | |
| 1215 | /* |
| 1216 | * Append address and data, and optionally, control (ancillary) data to the |
no test coverage detected