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

Function in_pcbdetach

freebsd/netinet/in_pcb.c:1619–1631  ·  view source on GitHub ↗

* in_pcbdetach() is responsibe for disassociating a socket from an inpcb. * For most protocols, this will be invoked immediately prior to calling * in_pcbfree(). However, with TCP the inpcb may significantly outlive the * socket, in which case in_pcbfree() is deferred. */

Source from the content-addressed store, hash-verified

1617 * socket, in which case in_pcbfree() is deferred.
1618 */
1619void
1620in_pcbdetach(struct inpcb *inp)
1621{
1622
1623 KASSERT(inp->inp_socket != NULL, ("%s: inp_socket == NULL", __func__));
1624
1625#ifdef RATELIMIT
1626 if (inp->inp_snd_tag != NULL)
1627 in_pcbdetach_txrtlmt(inp);
1628#endif
1629 inp->inp_socket->so_pcb = NULL;
1630 inp->inp_socket = NULL;
1631}
1632
1633/*
1634 * in_pcbref() bumps the reference count on an inpcb in order to maintain

Callers 9

udp_attachFunction · 0.85
udp_detachFunction · 0.85
div_detachFunction · 0.85
rip_detachFunction · 0.85
tcp_usr_attachFunction · 0.85
tcp_usr_detachFunction · 0.85
udp6_attachFunction · 0.85
udp6_detachFunction · 0.85
rip6_detachFunction · 0.85

Calls 1

in_pcbdetach_txrtlmtFunction · 0.85

Tested by

no test coverage detected