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

Function unp_drop

freebsd/kern/uipc_usrreq.c:1962–1984  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1960}
1961
1962static void
1963unp_drop(struct unpcb *unp)
1964{
1965 struct socket *so = unp->unp_socket;
1966 struct unpcb *unp2;
1967
1968 /*
1969 * Regardless of whether the socket's peer dropped the connection
1970 * with this socket by aborting or disconnecting, POSIX requires
1971 * that ECONNRESET is returned.
1972 */
1973
1974 UNP_PCB_LOCK(unp);
1975 if (so)
1976 so->so_error = ECONNRESET;
1977 if ((unp2 = unp_pcb_lock_peer(unp)) != NULL) {
1978 /* Last reference dropped in unp_disconnect(). */
1979 unp_pcb_rele_notlast(unp);
1980 unp_disconnect(unp, unp2);
1981 } else if (!unp_pcb_rele(unp)) {
1982 UNP_PCB_UNLOCK(unp);
1983 }
1984}
1985
1986static void
1987unp_freerights(struct filedescent **fdep, int fdcount)

Callers 2

uipc_abortFunction · 0.85
uipc_detachFunction · 0.85

Calls 4

unp_pcb_lock_peerFunction · 0.85
unp_pcb_rele_notlastFunction · 0.85
unp_disconnectFunction · 0.85
unp_pcb_releFunction · 0.85

Tested by

no test coverage detected