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

Function udp_detach

freebsd/netinet/udp_usrreq.c:1688–1709  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1686}
1687
1688static void
1689udp_detach(struct socket *so)
1690{
1691 struct inpcb *inp;
1692 struct inpcbinfo *pcbinfo;
1693 struct udpcb *up;
1694
1695 pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol);
1696 inp = sotoinpcb(so);
1697 KASSERT(inp != NULL, ("udp_detach: inp == NULL"));
1698 KASSERT(inp->inp_faddr.s_addr == INADDR_ANY,
1699 ("udp_detach: not disconnected"));
1700 INP_INFO_WLOCK(pcbinfo);
1701 INP_WLOCK(inp);
1702 up = intoudpcb(inp);
1703 KASSERT(up != NULL, ("%s: up == NULL", __func__));
1704 inp->inp_ppcb = NULL;
1705 in_pcbdetach(inp);
1706 in_pcbfree(inp);
1707 INP_INFO_WUNLOCK(pcbinfo);
1708 udp_discardcb(up);
1709}
1710
1711static int
1712udp_disconnect(struct socket *so)

Callers

nothing calls this directly

Calls 4

in_pcbdetachFunction · 0.85
in_pcbfreeFunction · 0.85
udp_discardcbFunction · 0.85
udp_get_inpcbinfoFunction · 0.70

Tested by

no test coverage detected