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

Function sbappendaddr_locked

freebsd/kern/uipc_sockbuf.c:1195–1213  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

1193 * mbufs.
1194 */
1195int
1196sbappendaddr_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

Callers 11

udp_appendFunction · 0.85
divert_packetFunction · 0.85
socket_sendFunction · 0.85
rip_appendFunction · 0.85
send_inputFunction · 0.85
icmp6_rip6_inputFunction · 0.85
udp6_appendFunction · 0.85
sbappendaddrFunction · 0.85
uipc_sendFunction · 0.85
ngs_rcvmsgFunction · 0.85
ngs_rcvdataFunction · 0.85

Calls 4

m_lengthFunction · 0.85
panicFunction · 0.70
sbspaceFunction · 0.50

Tested by

no test coverage detected