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

Function soabort

freebsd/kern/uipc_socket.c:1269–1288  ·  view source on GitHub ↗

* soabort() is used to abruptly tear down a connection, such as when a * resource limit is reached (listen queue depth exceeded), or if a listen * socket is closed while there are sockets waiting to be accepted. * * This interface is tricky, because it is called on an unreferenced socket, * and must be called only by a thread that has actually removed the socket * from the listen queue it wa

Source from the content-addressed store, hash-verified

1267 * to review in the future.
1268 */
1269void
1270soabort(struct socket *so)
1271{
1272
1273 /*
1274 * In as much as is possible, assert that no references to this
1275 * socket are held. This is not quite the same as asserting that the
1276 * current thread is responsible for arranging for no references, but
1277 * is as close as we can get for now.
1278 */
1279 KASSERT(so->so_count == 0, ("soabort: so_count"));
1280 KASSERT((so->so_state & SS_PROTOREF) == 0, ("soabort: SS_PROTOREF"));
1281 KASSERT(so->so_state & SS_NOFDREF, ("soabort: !SS_NOFDREF"));
1282 VNET_SO_ASSERT(so);
1283
1284 if (so->so_proto->pr_usrreqs->pru_abort != NULL)
1285 (*so->so_proto->pr_usrreqs->pru_abort)(so);
1286 SOCK_LOCK(so);
1287 sofree(so);
1288}
1289
1290int
1291soaccept(struct socket *so, struct sockaddr **nam)

Callers 4

tcp_syncache.cFile · 0.85
tcp_ctloutputFunction · 0.85
uipc_socket.cFile · 0.85
socloseFunction · 0.85

Calls 1

sofreeFunction · 0.85

Tested by

no test coverage detected